pub struct Data<T> { /* private fields */ }
Implementations§
Source§impl<T> Data<T>where
T: TlvEncode,
impl<T> Data<T>where
T: TlvEncode,
pub const fn new(name: Name, content: T) -> Self
pub fn name(&self) -> &Name
pub fn set_name(&mut self, name: Name) -> &mut Self
pub fn meta_info(&self) -> &Option<MetaInfo>
pub fn set_meta_info(&mut self, meta_info: Option<MetaInfo>) -> &mut Self
pub fn content(&self) -> Option<&T>
pub fn set_content(&mut self, content: Option<T>) -> &mut Self
pub fn encode_content(self) -> Data<Bytes>
pub fn sign<S>(&mut self, sign_method: &mut S)where
S: SignMethod,
pub fn sign_cert<S>(&mut self, sign_method: &S, validity_period: ValidityPeriod)where
S: SignMethod,
pub fn signature_info(&self) -> Option<&SignatureInfo>
pub fn is_signed(&self) -> bool
pub fn matches_interest<D>(&self, interest: &Interest<D>) -> bool
Sourcepub fn verify<S>(&self, sign_method: &S) -> Result<(), VerifyError>where
S: SignatureVerifier + ?Sized,
pub fn verify<S>(&self, sign_method: &S) -> Result<(), VerifyError>where
S: SignatureVerifier + ?Sized,
Verify the signature of this Data packet with the given SignMethod
Trait Implementations§
Source§impl<T> Tlv for Data<T>where
T: TlvEncode,
impl<T> Tlv for Data<T>where
T: TlvEncode,
Source§fn inner_size(&self) -> usize
fn inner_size(&self) -> usize
The size of the payload contained within this TLV Read more
Source§fn critical() -> bool
fn critical() -> bool
Whether the TLV is critical, see
tlv_critical
impl<T: Eq> Eq for Data<T>
impl<T> StructuralPartialEq for Data<T>
Auto Trait Implementations§
impl<T> !Freeze for Data<T>
impl<T> RefUnwindSafe for Data<T>where
T: RefUnwindSafe,
impl<T> Send for Data<T>where
T: Send,
impl<T> Sync for Data<T>where
T: Sync,
impl<T> Unpin for Data<T>where
T: Unpin,
impl<T> UnwindSafe for Data<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§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