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 a value with a four-byte versionstamp offset for API 520 and later.
For keys under an earlier runtime API, use pack_with_versionstamp_for_key.
§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
Pack a value into the buffer with a four-byte versionstamp offset for API
520 and later. For legacy keys, use pack_with_versionstamp_for_key or
Subspace::pack_with_versionstamp_for_key with the buffer as a prefix.
§Panics
Panics if the encoded data size doesn’t fit in u32.
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.