pub struct FipsEndpointDirectPacketRun { /* private fields */ }Expand description
Consecutive direct endpoint packets from one authenticated FIPS source.
Unlike FipsEndpointDirectSourceRun, this can preserve an opened
EndpointDataBulk buffer and expose packet slices by range. That is the
canonical direct PM2 endpoint payload contract for high-throughput embedders:
FIPS owns authentication and ordering, while the embedder can still apply
live routing policy before borrowing packet bytes for TUN writes.
Implementations§
Source§impl FipsEndpointDirectPacketRun
impl FipsEndpointDirectPacketRun
Sourcepub fn meta(&self) -> &FipsEndpointDirectPacketRunMeta
pub fn meta(&self) -> &FipsEndpointDirectPacketRunMeta
Authenticated source/session facts for this packet run.
Sourcepub fn source_peer(&self) -> &PeerIdentity
pub fn source_peer(&self) -> &PeerIdentity
Authenticated FIPS peer that originated every packet in this run.
Sourcepub fn source_node_addr(&self) -> &NodeAddr
pub fn source_node_addr(&self) -> &NodeAddr
FIPS node address that originated every packet in this run.
Sourcepub fn source_npub(&self) -> String
pub fn source_npub(&self) -> String
Source Nostr public key as human-facing bech32 text.
Sourcepub fn previous_hop_node_addr(&self) -> &NodeAddr
pub fn previous_hop_node_addr(&self) -> &NodeAddr
Authenticated previous hop for this established FSP receive run.
Sourcepub fn is_direct_path(&self) -> bool
pub fn is_direct_path(&self) -> bool
Whether FIPS received the run directly from the source node.
Sourcepub fn received_k_bit(&self) -> bool
pub fn received_k_bit(&self) -> bool
Whether the established FSP packet carried the key-epoch bit.
Sourcepub fn enqueued_at_ms(&self) -> u64
pub fn enqueued_at_ms(&self) -> u64
Unix-millisecond time when FIPS handed this run to the direct sink.
Sourcepub fn packet_bytes(&self) -> usize
pub fn packet_bytes(&self) -> usize
Sum of endpoint packet bytes, excluding bulk length metadata.
Sourcepub fn packet_slice(&self, index: usize) -> Option<&[u8]>
pub fn packet_slice(&self, index: usize) -> Option<&[u8]>
Borrow one packet by index.
Sourcepub fn packet_slice_mut(&mut self, index: usize) -> Option<&mut [u8]>
pub fn packet_slice_mut(&mut self, index: usize) -> Option<&mut [u8]>
Mutably borrow one packet by index.
Sourcepub fn packet_slices(&self) -> FipsEndpointDirectPacketSlices<'_>
pub fn packet_slices(&self) -> FipsEndpointDirectPacketSlices<'_>
Borrow packet bytes without materializing per-packet buffers.
Sourcepub fn partition_by_packet_lane<F>(
self,
lane_count: usize,
lane_for_packet: F,
) -> Vec<(usize, Self)>
pub fn partition_by_packet_lane<F>( self, lane_count: usize, lane_for_packet: F, ) -> Vec<(usize, Self)>
Partition this run into packet-lane groups without copying packet bytes.
The caller chooses a lane from immutable endpoint packet bytes. FIPS keeps authentication/session metadata on every child run and shares the opened endpoint payload buffer across lane runs.
Sourcepub fn retain_packets<F>(&mut self, keep: F)
pub fn retain_packets<F>(&mut self, keep: F)
Keep only packets accepted by the caller while preserving backing storage.
The predicate receives the original packet index and immutable bytes. This keeps routing/admission policy outside FIPS while allowing embedders to remove rejected ranges before a TUN writer borrows or mutates the run.
Sourcepub fn for_each_packet_mut<F>(&mut self, visit: F)
pub fn for_each_packet_mut<F>(&mut self, visit: F)
Visit each packet as mutable bytes while the run owner is borrowed.
Sourcepub fn into_source_run(self) -> FipsEndpointDirectSourceRun
pub fn into_source_run(self) -> FipsEndpointDirectSourceRun
Materialize this run into the older owned-packet source-run contract.
Sourcepub fn into_packets(self) -> Vec<PacketBuffer>
pub fn into_packets(self) -> Vec<PacketBuffer>
Materialize this run into owned packet buffers.
Trait Implementations§
Source§impl Clone for FipsEndpointDirectPacketRun
impl Clone for FipsEndpointDirectPacketRun
Source§fn clone(&self) -> FipsEndpointDirectPacketRun
fn clone(&self) -> FipsEndpointDirectPacketRun
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FipsEndpointDirectPacketRun
impl Debug for FipsEndpointDirectPacketRun
impl Eq for FipsEndpointDirectPacketRun
Source§impl PartialEq for FipsEndpointDirectPacketRun
impl PartialEq for FipsEndpointDirectPacketRun
Source§fn eq(&self, other: &FipsEndpointDirectPacketRun) -> bool
fn eq(&self, other: &FipsEndpointDirectPacketRun) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FipsEndpointDirectPacketRun
Auto Trait Implementations§
impl Freeze for FipsEndpointDirectPacketRun
impl RefUnwindSafe for FipsEndpointDirectPacketRun
impl Send for FipsEndpointDirectPacketRun
impl Sync for FipsEndpointDirectPacketRun
impl Unpin for FipsEndpointDirectPacketRun
impl UnsafeUnpin for FipsEndpointDirectPacketRun
impl UnwindSafe for FipsEndpointDirectPacketRun
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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