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 Data
impl EncodableOption for Data
Source§type EncodedOption = WireOptionalData<'static>
type EncodedOption = WireOptionalData<'static>
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 Data
impl<___E> EncodeOption<___E> for Data
Source§fn encode_option(
this: Option<Self>,
encoder: &mut ___E,
out: &mut MaybeUninit<Self::EncodedOption>,
) -> Result<(), EncodeError>
fn encode_option( this: Option<Self>, encoder: &mut ___E, out: &mut MaybeUninit<Self::EncodedOption>, ) -> Result<(), EncodeError>
Encodes this optional value into an encoder and output.
Source§impl<'de> FromWireOption<WireOptionalData<'de>> for Box<Data>
impl<'de> FromWireOption<WireOptionalData<'de>> for Box<Data>
Source§fn from_wire_option(wire: WireOptionalData<'de>) -> Option<Self>
fn from_wire_option(wire: WireOptionalData<'de>) -> Option<Self>
Converts the given
wire
to an option of this type.Auto 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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
§fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
Converts the given
wire
to an option of this type.