Struct picky_asn1::wrapper::HeaderOnly
source · pub struct HeaderOnly<T: Asn1Type>(pub PhantomData<T>);
Expand description
A wrapper encoding/decoding only the header of the provided Asn1Wrapper with a length of 0.
Examples:
use picky_asn1::wrapper::{ExplicitContextTag0, HeaderOnly};
use serde::{Serialize, Deserialize};
let tag_only = HeaderOnly::<ExplicitContextTag0<()>>::default();
let buffer = [0xA0, 0x00];
let encoded = picky_asn1_der::to_vec(&tag_only).expect("couldn't serialize");
assert_eq!(
encoded,
buffer,
);
let decoded: HeaderOnly<ExplicitContextTag0<()>> = picky_asn1_der::from_bytes(&buffer).expect("couldn't deserialize");
assert_eq!(
decoded,
tag_only,
);
Tuple Fields§
§0: PhantomData<T>
Trait Implementations§
source§impl<T: Asn1Type> Asn1Type for HeaderOnly<T>
impl<T: Asn1Type> Asn1Type for HeaderOnly<T>
source§impl<T: Clone + Asn1Type> Clone for HeaderOnly<T>
impl<T: Clone + Asn1Type> Clone for HeaderOnly<T>
source§fn clone(&self) -> HeaderOnly<T>
fn clone(&self) -> HeaderOnly<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Default + Asn1Type> Default for HeaderOnly<T>
impl<T: Default + Asn1Type> Default for HeaderOnly<T>
source§fn default() -> HeaderOnly<T>
fn default() -> HeaderOnly<T>
Returns the “default value” for a type. Read more
source§impl<'de, T> Deserialize<'de> for HeaderOnly<T>where
T: Asn1Type,
impl<'de, T> Deserialize<'de> for HeaderOnly<T>where
T: Asn1Type,
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq + Asn1Type> PartialEq for HeaderOnly<T>
impl<T: PartialEq + Asn1Type> PartialEq for HeaderOnly<T>
source§fn eq(&self, other: &HeaderOnly<T>) -> bool
fn eq(&self, other: &HeaderOnly<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd + Asn1Type> PartialOrd for HeaderOnly<T>
impl<T: PartialOrd + Asn1Type> PartialOrd for HeaderOnly<T>
source§fn partial_cmp(&self, other: &HeaderOnly<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &HeaderOnly<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T> Serialize for HeaderOnly<T>where
T: Asn1Type,
impl<T> Serialize for HeaderOnly<T>where
T: Asn1Type,
impl<T: Eq + Asn1Type> Eq for HeaderOnly<T>
impl<T: Asn1Type> StructuralPartialEq for HeaderOnly<T>
Auto Trait Implementations§
impl<T> Freeze for HeaderOnly<T>
impl<T> RefUnwindSafe for HeaderOnly<T>where
T: RefUnwindSafe,
impl<T> Send for HeaderOnly<T>where
T: Send,
impl<T> Sync for HeaderOnly<T>where
T: Sync,
impl<T> Unpin for HeaderOnly<T>where
T: Unpin,
impl<T> UnwindSafe for HeaderOnly<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)