pub trait TuplePack {
// Required method
fn pack<W>(
&self,
w: &mut W,
tuple_depth: TupleDepth,
) -> Result<VersionstampOffset, Error>
where W: Write;
// Provided methods
fn pack_root<W>(&self, w: &mut W) -> Result<VersionstampOffset, Error>
where W: Write { ... }
fn pack_to_vec(&self) -> Vec<u8> ⓘ { ... }
fn pack_to_vec_with_versionstamp(&self) -> Vec<u8> ⓘ { ... }
fn pack_into_vec(&self, output: &mut Vec<u8>) -> VersionstampOffset { ... }
fn pack_into_vec_with_versionstamp(
&self,
output: &mut Vec<u8>,
) -> VersionstampOffset { ... }
}
Expand description
A type that can be packed
Required Methods§
fn pack<W>(
&self,
w: &mut W,
tuple_depth: TupleDepth,
) -> Result<VersionstampOffset, Error>where
W: Write,
Provided Methods§
fn pack_root<W>(&self, w: &mut W) -> Result<VersionstampOffset, Error>where
W: Write,
Sourcefn pack_to_vec(&self) -> Vec<u8> ⓘ
fn pack_to_vec(&self) -> Vec<u8> ⓘ
Pack value and returns the packed buffer
§Panics
Panics if the encoded data size doesn’t fit in u32
.
Sourcefn pack_to_vec_with_versionstamp(&self) -> Vec<u8> ⓘ
fn pack_to_vec_with_versionstamp(&self) -> Vec<u8> ⓘ
Pack value and returns the packed buffer
§Panics
Panics if there is multiple versionstamp present or if the encoded data size doesn’t fit in u32
.
Sourcefn pack_into_vec(&self, output: &mut Vec<u8>) -> VersionstampOffset
fn pack_into_vec(&self, output: &mut Vec<u8>) -> VersionstampOffset
Sourcefn pack_into_vec_with_versionstamp(
&self,
output: &mut Vec<u8>,
) -> VersionstampOffset
fn pack_into_vec_with_versionstamp( &self, output: &mut Vec<u8>, ) -> VersionstampOffset
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.