diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-04-25 03:50:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-25 03:50:17 +0000 |
| commit | dac943e3d79def7d2c322450790f16f027735941 (patch) | |
| tree | 3beafa3c8035c69a33b7d0f12779236bf786cf36 /azalea-protocol/src/mc_buf/mod.rs | |
| parent | b7641ff308aab7840d2a2253ae50f8ee496b2a97 (diff) | |
| parent | f4dd3a9293367fa8f3d839a184e8055b22595204 (diff) | |
| download | azalea-drasl-dac943e3d79def7d2c322450790f16f027735941.tar.xz | |
Merge pull request #3 from mat-1/auth
Auth
Diffstat (limited to 'azalea-protocol/src/mc_buf/mod.rs')
| -rwxr-xr-x | azalea-protocol/src/mc_buf/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/azalea-protocol/src/mc_buf/mod.rs b/azalea-protocol/src/mc_buf/mod.rs index 4ecb65d1..3ba6ac3e 100755 --- a/azalea-protocol/src/mc_buf/mod.rs +++ b/azalea-protocol/src/mc_buf/mod.rs @@ -5,11 +5,31 @@ mod write; pub use read::{McBufReadable, McBufVarintReadable, Readable}; pub use write::{McBufVarintWritable, McBufWritable, Writable}; +use std::ops::Deref; // const DEFAULT_NBT_QUOTA: u32 = 2097152; const MAX_STRING_LENGTH: u16 = 32767; // const MAX_COMPONENT_STRING_LENGTH: u32 = 262144; + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct ByteArray(Vec<u8>); + +impl Deref for ByteArray { + type Target = Vec<u8>; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From<Vec<u8>> for ByteArray { + fn from(vec: Vec<u8>) -> Self { + Self(vec) + } +} + + #[cfg(test)] mod tests { use super::*; |
