pub struct PacketHash(/* private fields */);Implementations§
Source§impl PacketHash
impl PacketHash
pub const fn new(bytes: [u8; 32]) -> PacketHash
pub const fn as_bytes(&self) -> &[u8; 32]
Sourcepub fn of_wire_packet(bytes: &[u8]) -> Result<PacketHash, WireError>
pub fn of_wire_packet(bytes: &[u8]) -> Result<PacketHash, WireError>
RNS 1.4.2 Packet.get_hashable_part: a packet’s identity is the flag bits that name what it is (destination type + packet type), the destination, context, and payload (never the hops count or the in-transport id), so the hash survives relaying unchanged.
Sourcepub fn proof_destination(&self) -> DestinationHash
pub fn proof_destination(&self) -> DestinationHash
RNS 1.4.2 ProofDestination: a proof of receipt is addressed to the first TRUNCATED_HASH_BYTE_LEN bytes of the proved packet’s hash.
The sender derives the same address from its own copy and matches the proof to its receipt.
Sourcepub fn of_data_fields(
destination_type: DestinationType,
address: &WireAddress,
context: WireContext,
payload: &[u8],
) -> PacketHash
pub fn of_data_fields( destination_type: DestinationType, address: &WireAddress, context: WireContext, payload: &[u8], ) -> PacketHash
The same hash as Self::of_wire_packet, reconstructed from a data packet’s typed fields (what the engine holds after classification), with the wire buffer already carved up.
pub fn of_fields( destination_type: DestinationType, packet_type: PacketType, address: &WireAddress, context: WireContext, payload: &[u8], ) -> PacketHash
Trait Implementations§
Source§impl Clone for PacketHash
impl Clone for PacketHash
Source§fn clone(&self) -> PacketHash
fn clone(&self) -> PacketHash
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PacketHash
Source§impl Debug for PacketHash
impl Debug for PacketHash
impl Eq for PacketHash
Source§impl IndexKey for PacketHash
impl IndexKey for PacketHash
fn lemire_key(&self) -> u64
Source§impl PartialEq for PacketHash
impl PartialEq for PacketHash
impl StructuralPartialEq for PacketHash
Auto Trait Implementations§
impl Freeze for PacketHash
impl RefUnwindSafe for PacketHash
impl Send for PacketHash
impl Sync for PacketHash
impl Unpin for PacketHash
impl UnsafeUnpin for PacketHash
impl UnwindSafe for PacketHash
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