pub enum Data {
Bytes(Vec<u8>),
Buffer(Buffer),
UnknownOrdinal_(u64),
}
Expand description
Binary data that might be stored inline or in a VMO.
Useful for performance-sensitive protocols that sometimes receive small
amounts of binary data (i.e., which is more efficient to provide using
bytes
) but also need to support arbitrary amounts of data (i.e., which
need to be provided out-of-line in a Buffer
).
Variants§
Trait Implementations§
Source§impl EncodableOption for Box<Data>
impl EncodableOption for Box<Data>
Source§type EncodedOption = WireOptionalData
type EncodedOption = WireOptionalData
The wire type for the optional value.
Source§impl<___E> Encode<___E> for Datawhere
___E: InternalHandleEncoder + ?Sized + Encoder + HandleEncoder,
impl<___E> Encode<___E> for Datawhere
___E: InternalHandleEncoder + ?Sized + Encoder + HandleEncoder,
Source§impl<___E> EncodeOption<___E> for Box<Data>
impl<___E> EncodeOption<___E> for Box<Data>
Source§fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
out: &mut MaybeUninit<Self::EncodedOption>,
) -> Result<(), EncodeError>
fn encode_option( this: Option<&mut Self>, encoder: &mut ___E, out: &mut MaybeUninit<Self::EncodedOption>, ) -> Result<(), EncodeError>
Encodes this optional value into an encoder and output.
Source§impl TakeFrom<WireData> for Data
impl TakeFrom<WireData> for Data
Source§fn take_from(from: &WireData) -> Self
fn take_from(from: &WireData) -> Self
Converts from the given
T
, taking any resources that can’t be cloned.§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
An optimization flag that allows the bytes of this type to be copied directly during
conversion instead of calling
take_from
. Read moreAuto Trait Implementations§
impl Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnwindSafe for Data
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more