Weave documentation
Filament referencefilament-packet

filament-packet · packet

Source declarations, signatures and documentation for packet.

Read the current implementation boundaries before integration. This reference reproduces declarations; it omits source comments whose examples or readiness claims have not been verified.

Source: sigil/weave/filament/filament-packet/src/packet.rs. SHA-256: 21b379573c0dd9f79c6a1fcc40ac501f7bbeb1df3b557405ee19335d17522650.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

packet::Packet

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Packet {
/// Packet header (2 bytes).

pub header: Header,
/// Interface Authentication Code (0-64 bytes, optional).

pub ifac: Option<Bytes>,
/// Destination hash (16 bytes) or dual addresses (32 bytes).

pub addresses: Bytes,
/// Context byte (1 byte, optional).

pub context: Option<u8>,
/// Packet data payload (variable length).

pub data: Bytes
}

Source line: 15.

packet::Packet::new

pub fn new(
        packet_type: PacketType,
        destination_type: DestinationType,
        addresses: impl Into<Bytes>,
        data: impl Into<Bytes>,
    ) -> Result<Self>;

Source line: 34.

packet::Packet::with_ifac

pub fn with_ifac(mut self, ifac: impl Into<Bytes>) -> Result<Self>;

Source line: 69.

packet::Packet::with_header_type

pub fn with_header_type(mut self, header_type: HeaderType) -> Result<Self>;

Source line: 89.

packet::Packet::with_context

pub fn with_context(mut self, context: u8) -> Result<Self>;

Source line: 103.

packet::Packet::with_propagation

pub fn with_propagation(mut self, propagation: PropagationType) -> Self;

Source line: 112.

packet::Packet::with_hop_count

pub fn with_hop_count(mut self, hop_count: u8) -> Self;

Source line: 118.

packet::Packet::parse

pub fn parse(bytes: impl Into<Bytes>) -> Result<Self>;

Source line: 126.

packet::Packet::encode

pub fn encode(&self) -> Result<Vec<u8>>;

Source line: 205.

packet::Packet::total_size

#[inline]
pub fn total_size(&self) -> usize;

Source line: 244.

packet::Packet::validate_size

pub fn validate_size(&self) -> Result<()>;

Source line: 263.

packet::Packet::max_payload_size

pub fn max_payload_size(&self) -> usize;

Source line: 272.

packet::Packet::is_data

#[inline]
pub fn is_data(&self) -> bool;

Source line: 287.

packet::Packet::is_announce

#[inline]
pub fn is_announce(&self) -> bool;

Source line: 293.

#[inline]
pub fn is_link_request(&self) -> bool;

Source line: 299.

packet::Packet::is_proof

#[inline]
pub fn is_proof(&self) -> bool;

Source line: 305.

On this page