Enum cbor4ii::core::dec::Reference

source ·
pub enum Reference<'de, 'short> {
    Long(&'de [u8]),
    Short(&'short [u8]),
}
Expand description

Bytes reference

Variants§

§

Long(&'de [u8])

If the reader can return bytes as long as its lifetime, then zero-copy decoding will be allowed.

§

Short(&'short [u8])

Bytes returned normally

Implementations§

source§

impl<'de, 'short> Reference<'de, 'short>

source

pub const fn as_ref(&self) -> &[u8]

source

pub fn take(&self, len: usize) -> Reference<'de, 'short>

Auto Trait Implementations§

§

impl<'de, 'short> RefUnwindSafe for Reference<'de, 'short>

§

impl<'de, 'short> Send for Reference<'de, 'short>

§

impl<'de, 'short> Sync for Reference<'de, 'short>

§

impl<'de, 'short> Unpin for Reference<'de, 'short>

§

impl<'de, 'short> UnwindSafe for Reference<'de, 'short>

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.