Skip to main content

CborValue

Enum CborValue 

Source
pub enum CborValue<'i> {
    Integer(i128),
    Bytes(CborBytes<'i>),
    Text(CborText<'i>),
    Array(CborArray<'i>),
    Map(CborMap<'i>),
    Tag(u64, Box<CborValue<'i>>),
    Float(CborFloat),
    Bool(bool),
    Null,
    Undefined,
    Simple(u8),
}
Expand description

Generic CBOR value.

Variants§

§

Integer(i128)

An integer in the RFC 8949 range -2^64 ..= 2^64 - 1.

§

Bytes(CborBytes<'i>)

§

Text(CborText<'i>)

§

Array(CborArray<'i>)

§

Map(CborMap<'i>)

§

Tag(u64, Box<CborValue<'i>>)

§

Float(CborFloat)

§

Bool(bool)

§

Null

§

Undefined

§

Simple(u8)

An unassigned/registered simple value other than 20 through 23.

Implementations§

Source§

impl<'i> CborValue<'i>

Source

pub fn arrow_0(self) -> u8

Source

pub fn arrow_1(self) -> Box<CborValue<'i>>

Source

pub fn arrow_Integer_0(self) -> i128

Source

pub fn arrow_Bytes_0(self) -> CborBytes<'i>

Source

pub fn arrow_Text_0(self) -> CborText<'i>

Source

pub fn arrow_Array_0(self) -> CborArray<'i>

Source

pub fn arrow_Map_0(self) -> CborMap<'i>

Source

pub fn arrow_Tag_0(self) -> u64

Source

pub fn arrow_Tag_1(self) -> Box<CborValue<'i>>

Source

pub fn arrow_Float_0(self) -> CborFloat

Source

pub fn arrow_Bool_0(self) -> bool

Source

pub fn arrow_Simple_0(self) -> u8

Trait Implementations§

Source§

impl<'i, const DET: bool, const LIMIT: usize> ByteLen<CborValue<'i>> for CborFmt<DET, LIMIT>

Source§

exec fn length(&self, value: &CborValue<'i>) -> usize

Source§

fn exec_inv(&self) -> bool

Source§

impl<'i> Debug for CborValue<'i>

Source§

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

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

impl<'i> DeepView for CborValue<'i>

Source§

open spec fn deep_view(&self) -> Self::V

{ cbor_value_view(self) }
Source§

type V = CborValueSpec

Source§

impl<'i> PartialEq for CborValue<'i>

Source§

fn eq(&self, other: &CborValue<'i>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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<'i, const DET: bool, const LIMIT: usize> Prepare<CborValue<'i>> for CborFmt<DET, LIMIT>
where CborRecBody<DET>: SpecRecBody<Param = (), T = CborValueSpec, Body = CborBodyFmt<DET>> + PrepareRecBody<CborValue<'i>, EP = ()>,

Source§

impl<'i> PrepareRecBody<CborValue<'i>> for CborRecBody<false>
where CborRecBody<false>: SpecRecBody<Param = (), T = CborValueSpec, Body = CborBodyFmt<false>>,

Source§

exec fn prepare_body<Exec>( &self, _param: &(), spec_rec: Ghost<ParamRecSpecs<(), CborValueSpec>>, exec_rec: Exec, value: &CborValue<'i>, ) -> Result<usize, PreSerializeError>
where Exec: Fn(&(), &CborValue<'i>) -> Result<usize, PreSerializeError>,

Source§

type EP = ()

Source§

impl<'i> PrepareRecBody<CborValue<'i>> for CborRecBody<true>
where CborRecBody<true>: SpecRecBody<Param = (), T = CborValueSpec, Body = CborBodyFmt<true>>,

Source§

exec fn prepare_body<Exec>( &self, _param: &(), spec_rec: Ghost<ParamRecSpecs<(), CborValueSpec>>, exec_rec: Exec, value: &CborValue<'i>, ) -> Result<usize, PreSerializeError>
where Exec: Fn(&(), &CborValue<'i>) -> Result<usize, PreSerializeError>,

Source§

type EP = ()

Source§

impl<'i, Output: OutputBuf, const DET: bool, const LIMIT: usize> Serializer<Output, CborValue<'i>> for CborFmt<DET, LIMIT>

Source§

exec fn serialize_into(&self, value: &CborValue<'i>, out: &mut Output)

Source§

fn exec_inv(&self) -> bool

Source§

impl<'i, Output: OutputBuf, const DET: bool> SerializerRecBody<Output, CborValue<'i>> for CborRecBody<DET>

Source§

exec fn serialize_body<Exec>( &self, _param: &(), Ghost(spec_rec): Ghost<ParamRecSpecs<(), CborValueSpec>>, exec_rec: Exec, value: &CborValue<'i>, out: &mut Output, )
where Exec: Fn(&(), &CborValue<'i>, &mut Output),

Source§

type EP = ()

Source§

impl<'i> Eq for CborValue<'i>

Source§

impl<'i> StructuralPartialEq for CborValue<'i>

Auto Trait Implementations§

§

impl<'i> Freeze for CborValue<'i>

§

impl<'i> RefUnwindSafe for CborValue<'i>

§

impl<'i> Send for CborValue<'i>

§

impl<'i> Sync for CborValue<'i>

§

impl<'i> Unpin for CborValue<'i>

§

impl<'i> UnsafeUnpin for CborValue<'i>

§

impl<'i> UnwindSafe for CborValue<'i>

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
§

impl<VERUS_SPEC__A> DebugSpec for VERUS_SPEC__A
where VERUS_SPEC__A: Debug + ?Sized,

§

fn fmt_req(&self, f: &Formatter<'_>) -> bool

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: From<T>,

§

fn obeys_from_spec() -> bool

§

fn from_spec(v: T) -> VERUS_SPEC__A

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.

§

impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: Into<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> T

§

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

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> U

§

impl<A, Rhs> PartialEqIs<Rhs> for A
where A: PartialEq<Rhs> + ?Sized, Rhs: ?Sized,

§

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

§

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

§

impl<Rhs, VERUS_SPEC__A> PartialEqSpec<Rhs> for VERUS_SPEC__A
where VERUS_SPEC__A: PartialEq<Rhs> + ?Sized, Rhs: ?Sized,

§

fn obeys_eq_spec() -> bool

§

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

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.
§

impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryFrom<T>,

§

fn obeys_try_from_spec() -> bool

§

fn try_from_spec( v: T, ) -> Result<VERUS_SPEC__A, <VERUS_SPEC__A as TryFrom<T>>::Error>

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.
§

impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryInto<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<T, <VERUS_SPEC__A as TryInto<T>>::Error>

§

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

§

fn obeys_try_into_spec() -> bool

§

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

§

impl<A> SpecEq<&A> for A
where A: ?Sized,

§

impl<A> SpecEq<&mut A> for A
where A: ?Sized,

§

impl<A> SpecEq<A> for A
where A: ?Sized,

§

impl<A> SpecEq<Ghost<A>> for A

§

impl<A> SpecEq<Tracked<A>> for A