Skip to main content

Any

Enum Any 

Source
pub enum Any<'de> {
Show 20 variants Nil, Bool(bool), U8(u8), U16(u16), U32(u32), U64(u64), I8(i8), I16(i16), I32(i32), I64(i64), F32(f32), F64(f64), StrBorrowed(&'de str), StrCopied(usize), BinBorrowed(&'de [u8]), BinCopied(usize), Array(usize), Map(usize), ExtBorrowed { type: i8, data: &'de [u8], }, ExtCopied { type: i8, len: usize, },
}
Expand description

Skip a single MessagePack value from the reader.

This reads and discards one complete value (including nested containers). Useful when encountering unknown map keys during decoding.

Variants§

§

Nil

Nil

§

Bool(bool)

true / false

§

U8(u8)

positive fixint / uint8

§

U16(u16)

uint16

§

U32(u32)

uint32

§

U64(u64)

uint64

§

I8(i8)

negative fixint / int8

§

I16(i16)

int16

§

I32(i32)

int32

§

I64(i64)

int64

§

F32(f32)

float32

§

F64(f64)

float64

§

StrBorrowed(&'de str)

fixstr / str8 / str16 / str32 (borrowed)

§

StrCopied(usize)

fixstr / str8 / str16 / str32 (copied)

§

BinBorrowed(&'de [u8])

bin8 / bin16 / bin32 (borrowed)

§

BinCopied(usize)

bin8 / bin16 / bin32 (copied)

§

Array(usize)

fixarray / array16 / array32

§

Map(usize)

fixmap / map16 / map32

§

ExtBorrowed

fixext1 / fixext2 / fixext4 / fixext8 / fixext16 / ext8 / ext16 / ext32 (borrowed)

Fields

§type: i8

extension type

§data: &'de [u8]

extension data

§

ExtCopied

fixext1 / fixext2 / fixext4 / fixext8 / fixext16 / ext8 / ext16 / ext32 (copied)

Fields

§type: i8

extension type

§len: usize

extension data length

Trait Implementations§

Source§

impl<'de> Clone for Any<'de>

Source§

fn clone(&self) -> Any<'de>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'de> Debug for Any<'de>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> DecodeBorrowed<'de> for Any<'de>

Source§

type Value = Any<'de>

The decoded value.
Source§

fn decode_borrowed_with_format<R>( format: Format, reader: &mut R, ) -> Result<<Self as DecodeBorrowed<'de>>::Value, Error<R::Error>>
where R: IoRead<'de>,

Decode with a previously read Format.
Source§

fn decode_borrowed<R>( reader: &mut R, ) -> Result<<Self as DecodeBorrowed<'de>>::Value, Error<R::Error>>
where R: IoRead<'de>,

Decode the next value.
Source§

impl<'de> PartialEq for Any<'de>

Source§

fn eq(&self, other: &Any<'de>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'de> Copy for Any<'de>

Source§

impl<'de> StructuralPartialEq for Any<'de>

Auto Trait Implementations§

§

impl<'de> Freeze for Any<'de>

§

impl<'de> RefUnwindSafe for Any<'de>

§

impl<'de> Send for Any<'de>

§

impl<'de> Sync for Any<'de>

§

impl<'de> Unpin for Any<'de>

§

impl<'de> UnsafeUnpin for Any<'de>

§

impl<'de> UnwindSafe for Any<'de>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<'de, T> Decode<'de> for T
where T: DecodeBorrowed<'de> + 'de,

Source§

type Value<'a> = <T as DecodeBorrowed<'de>>::Value where 'de: 'a, T: 'a

The decoded value (may borrow for 'a).
Source§

fn decode_with_format<'a, R>( format: Format, reader: &'a mut R, ) -> Result<<T as Decode<'de>>::Value<'a>, Error<<R as IoRead<'de>>::Error>>
where 'de: 'a, R: IoRead<'de>,

Decode with a previously read Format.
Source§

fn decode<'a, R>(reader: &'a mut R) -> Result<Self::Value<'a>, Error<R::Error>>
where R: IoRead<'de>, 'de: 'a,

Decode the next value.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.