Struct Cbor
pub struct Cbor<T>(pub T)
where
T: AsRef<[u8]>;Expand description
A newtype around byte slices used for all of Ariel OS’s logging facades that prefers interpreting the data as CBOR.
Its preferred output is CBOR Diagnostic Notation (EDN), but showing hex is also acceptable.
Instead of writing some variation of info!("Found bytes {:cbor}", item), you can write
info!("Found bytes {}", Cbor(item)).
Note that using this wrapper is not necessary when using a
cboritem::CborItem as it
already does something similar on its own.
Tuple Fields§
§0: TTrait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Cbor<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cbor<T>where
T: RefUnwindSafe,
impl<T> Send for Cbor<T>where
T: Send,
impl<T> Sync for Cbor<T>where
T: Sync,
impl<T> Unpin for Cbor<T>where
T: Unpin,
impl<T> UnwindSafe for Cbor<T>where
T: UnwindSafe,
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