pub enum Size {
Head,
Bytes(u64),
Items(u64),
Indef,
}Expand description
Information about a CBOR item size.
§Usage example
use minicbor::decode::info::Size;
let val = vec![1, 2, 3, 4, 5];
let cbor = minicbor::to_vec(val)?;
let hlen = Size::head(cbor[0])?;
let size = Size::tail(&cbor[.. hlen])?;
assert_eq!(Size::Items(5), size);Variants§
Head
The item consists only of the head.
Bytes(u64)
The item is some text or byte string with the given number of bytes.
Items(u64)
The item is an array or map with the given number of items.
Indef
The item is an indefinite value.
Implementations§
Trait Implementations§
impl Copy for Size
impl Eq for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnsafeUnpin for Size
impl UnwindSafe for Size
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more