pub struct KeepRaw<'b, T> { /* private fields */ }Expand description
Decodes a struct while preserving original CBOR
§Examples
use pallas_codec::utils::KeepRaw;
let a = (123u16, (456u16, 789u16), 123u16);
let data = minicbor::to_vec(a).unwrap();
let (_, keeper, _): (u16, KeepRaw<(u16, u16)>, u16) = minicbor::decode(&data).unwrap();
let confirm: (u16, u16) = minicbor::decode(keeper.raw_cbor()).unwrap();
assert_eq!(confirm, (456u16, 789u16));Implementations§
Trait Implementations§
Source§impl<'b, T: Ord> Ord for KeepRaw<'b, T>
impl<'b, T: Ord> Ord for KeepRaw<'b, T>
Source§impl<'b, T: PartialOrd> PartialOrd for KeepRaw<'b, T>
impl<'b, T: PartialOrd> PartialOrd for KeepRaw<'b, T>
impl<'b, T: Eq> Eq for KeepRaw<'b, T>
impl<'b, T> StructuralPartialEq for KeepRaw<'b, T>
Auto Trait Implementations§
impl<'b, T> Freeze for KeepRaw<'b, T>where
T: Freeze,
impl<'b, T> RefUnwindSafe for KeepRaw<'b, T>where
T: RefUnwindSafe,
impl<'b, T> Send for KeepRaw<'b, T>where
T: Send,
impl<'b, T> Sync for KeepRaw<'b, T>where
T: Sync,
impl<'b, T> Unpin for KeepRaw<'b, T>where
T: Unpin,
impl<'b, T> UnwindSafe for KeepRaw<'b, T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)