Struct Bytes

Source
pub struct Bytes;
Expand description

This type is used to represent a borrowed &[u8] in a state object.

Trait Implementations§

Source§

impl KeyFieldValue for Bytes

Source§

fn encode<'a>( key: &<Bytes as ObjectFieldValue>::In<'a>, writer: &mut ReverseSliceWriter<'_>, ) -> Result<(), EncodeError>

Encode the key segment as a non-terminal segment.
Source§

fn encode_terminal<'a>( key: &<Bytes as ObjectFieldValue>::In<'a>, writer: &mut ReverseSliceWriter<'_>, ) -> Result<(), EncodeError>

Encode the key segment as the terminal segment.
Source§

fn decode<'a>( reader: &mut &'a [u8], memory_manager: &'a MemoryManager, ) -> Result<<Bytes as ObjectFieldValue>::Out<'a>, DecodeError>

Decode the key segment as a non-terminal segment.
Source§

fn decode_terminal<'a>( reader: &mut &'a [u8], memory_manager: &'a MemoryManager, ) -> Result<<Bytes as ObjectFieldValue>::Out<'a>, DecodeError>

Decode the key segment as the terminal segment.
Source§

fn out_size<'a>(key: &<Bytes as ObjectFieldValue>::In<'a>) -> usize

Get the size of the key segment as a non-terminal segment.
Source§

fn out_size_terminal<'a>(key: &<Bytes as ObjectFieldValue>::In<'a>) -> usize

Get the size of the key segment as the terminal segment.
Source§

impl ObjectFieldValue for Bytes

Source§

type In<'a> = &'a [u8]

The type that is used when inputting object values to functions.
Source§

type Out<'a> = &'a [u8]

The type that is used in function return values.

Auto Trait Implementations§

§

impl Freeze for Bytes

§

impl RefUnwindSafe for Bytes

§

impl Send for Bytes

§

impl Sync for Bytes

§

impl Unpin for Bytes

§

impl UnwindSafe for Bytes

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<A> ObjectKey for A
where A: KeyFieldValue,

Source§

fn encode<'a>( key: &<A as ObjectValue>::In<'a>, writer: &mut ReverseSliceWriter<'_>, ) -> Result<(), EncodeError>

Encode the key.
Source§

fn decode<'a>( input: &'a [u8], memory_manager: &'a MemoryManager, ) -> Result<<A as ObjectValue>::Out<'a>, DecodeError>

Decode the key.
Source§

fn out_size<'a>(key: &<A as ObjectValue>::In<'a>) -> usize

Compute the output buffer size for the key.
Source§

impl<A> ObjectValue for A

Source§

const PSEUDO_TYPE: StructType<'static>

The associated “pseudo-struct” type for the object value.
Source§

type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type,)

The object value types as field types.
Source§

type In<'a> = <A as ObjectFieldValue>::In<'a>

The type that is used when inputting object values to functions.
Source§

type Out<'a> = <A as ObjectFieldValue>::Out<'a>

The type that is used in function return values.
Source§

fn encode<'a>( value: &<A as ObjectValue>::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>

Encode each part of the value in reverse order.
Source§

fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<<A as ObjectValue>::Out<'a>, DecodeError>

Decode the value from the decoder.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.