pub struct Data {
pub name: Arc<Name>,
/* private fields */
}Expand description
An NDN Data packet.
Stores wire-format bytes for zero-copy CS storage and signature verification.
The signed region is contiguous in the wire encoding — it is sliced directly
from raw without copying.
Fields§
§name: Arc<Name>Name — always decoded eagerly.
Implementations§
Source§impl Data
impl Data
Sourcepub fn decode(raw: Bytes) -> Result<Data, PacketError>
pub fn decode(raw: Bytes) -> Result<Data, PacketError>
Decode a Data packet from raw wire bytes.
Sourcepub fn signed_region(&self) -> &[u8] ⓘ
pub fn signed_region(&self) -> &[u8] ⓘ
The signed region — a zero-copy slice suitable for signature verification.
Sourcepub fn sig_value(&self) -> &[u8] ⓘ
pub fn sig_value(&self) -> &[u8] ⓘ
The signature value bytes — a zero-copy slice.
sig_value_start points to the SignatureValue TLV’s type byte (0x17).
This method parses past the type and length to return only the raw value bytes.
pub fn raw(&self) -> &Bytes
Sourcepub fn implicit_digest(&self) -> Digest
pub fn implicit_digest(&self) -> Digest
The implicit SHA-256 digest of this Data packet — the SHA-256 hash of the full wire encoding. Used for exact Data retrieval via ImplicitSha256DigestComponent (type 0x01) in Interest names.
pub fn content(&self) -> Option<&Bytes>
pub fn meta_info(&self) -> Option<&MetaInfo>
pub fn sig_info(&self) -> Option<&SignatureInfo>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnwindSafe for Data
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