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<'de, T: Deserialize<'de>> Deserialize<'de> for KeepRaw<'_, T>
impl<'de, T: Deserialize<'de>> Deserialize<'de> for KeepRaw<'_, T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Note that the KeepRaw value obtained from this implementation does
not include a valid CBOR representation.
Source§impl<'b, T: Ord> Ord for KeepRaw<'b, T>
impl<'b, T: Ord> Ord for KeepRaw<'b, T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'b, T: PartialEq> PartialEq for KeepRaw<'b, T>
impl<'b, T: PartialEq> PartialEq 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> UnsafeUnpin for KeepRaw<'b, T>where
T: UnsafeUnpin,
impl<'b, T> UnwindSafe for KeepRaw<'b, 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