pub struct NativePeer { /* private fields */ }Implementations§
Source§impl NativePeer
impl NativePeer
Sourcepub fn pair_ipc(
a_controller: &[u8],
b_controller: &[u8],
scope: ScopeEpoch,
mtu: u16,
) -> Result<(Self, Self), QdnfError>
pub fn pair_ipc( a_controller: &[u8], b_controller: &[u8], scope: ScopeEpoch, mtu: u16, ) -> Result<(Self, Self), QdnfError>
Two connected native peers over local-ipc-v1. Transport only; no session.
Both cells are admitted from one HostAdmission aggregate (2 * cell).
Sourcepub fn release_into_host(
&mut self,
host: &mut HostAdmission,
) -> Result<(), QdnfError>
pub fn release_into_host( &mut self, host: &mut HostAdmission, ) -> Result<(), QdnfError>
Return this peer’s host cell to host. No-op when constructed without one.
Source§impl NativePeer
impl NativePeer
Sourcepub fn announce(
&mut self,
dest: &ObservedLocator,
now_unix: u64,
) -> Result<(), QdnfError>
pub fn announce( &mut self, dest: &ObservedLocator, now_unix: u64, ) -> Result<(), QdnfError>
QLink beacon announce. Replaces mDNS. Tag is HMAC-bound, not a DID.
Sourcepub fn accept_announce(&mut self) -> Result<LinkId, QdnfError>
pub fn accept_announce(&mut self) -> Result<LinkId, QdnfError>
Accept using now_unix = 1. Callers with a clock use Self::accept_announce_at.
Source§impl NativePeer
impl NativePeer
Sourcepub fn activate_protected(
&mut self,
permit: ExecutionPermit,
keys: InstalledSessionKeys,
now_unix: u64,
) -> Result<SessionHandle, QdnfError>
pub fn activate_protected( &mut self, permit: ExecutionPermit, keys: InstalledSessionKeys, now_unix: u64, ) -> Result<SessionHandle, QdnfError>
Activates a protected session (handshake + capability negotiation); returns the session handle.
Sourcepub fn close_session(&mut self, h: SessionHandle) -> Result<(), QdnfError>
pub fn close_session(&mut self, h: SessionHandle) -> Result<(), QdnfError>
Closes session h; QdnfError on unknown/invalid handle.
Sourcepub fn live_session_count(&self) -> usize
pub fn live_session_count(&self) -> usize
Number of live sessions.
Sourcepub fn remaining_host_bytes(&self) -> u64
pub fn remaining_host_bytes(&self) -> u64
Remaining host byte budget.
Sourcepub fn primary_session(&self) -> Option<SessionHandle>
pub fn primary_session(&self) -> Option<SessionHandle>
The primary session handle, if any.
Sourcepub fn cancel(&mut self) -> Result<CancelEpoch, QdnfError>
pub fn cancel(&mut self) -> Result<CancelEpoch, QdnfError>
Cancel in-flight send/recv. Does not commit application offsets.
Sourcepub fn rekey_protected(
&mut self,
table: &mut RekeyTable,
) -> Result<u64, QdnfError>
pub fn rekey_protected( &mut self, table: &mut RekeyTable, ) -> Result<u64, QdnfError>
Traffic-secret update. Does not mint a new permit or grant.
Sourcepub fn network_pass(&mut self, charge: PassCharge) -> Result<u64, QdnfError>
pub fn network_pass(&mut self, charge: PassCharge) -> Result<u64, QdnfError>
Charge one Sentinel network pass (accounting only; no 42 MiB map).
Sourcepub fn send_stream(
&mut self,
dest: &ObservedLocator,
payload: &[u8],
) -> Result<usize, QdnfError>
pub fn send_stream( &mut self, dest: &ObservedLocator, payload: &[u8], ) -> Result<usize, QdnfError>
Sends stream bytes on the primary session.
Sourcepub fn recv_stream(&mut self, out: &mut [u8]) -> Result<usize, QdnfError>
pub fn recv_stream(&mut self, out: &mut [u8]) -> Result<usize, QdnfError>
Receives stream bytes into out; returns bytes read.
Sourcepub fn send_protected(
&mut self,
dest: &ObservedLocator,
payload: &[u8],
) -> Result<SealedFrame, QdnfError>
pub fn send_protected( &mut self, dest: &ObservedLocator, payload: &[u8], ) -> Result<SealedFrame, QdnfError>
Sends a protected frame on the primary session.
Sourcepub fn send_protected_on(
&mut self,
h: SessionHandle,
dest: &ObservedLocator,
payload: &[u8],
) -> Result<SealedFrame, QdnfError>
pub fn send_protected_on( &mut self, h: SessionHandle, dest: &ObservedLocator, payload: &[u8], ) -> Result<SealedFrame, QdnfError>
Sends a protected frame on session h.
Sourcepub fn recv_protected(&mut self, out: &mut [u8]) -> Result<usize, QdnfError>
pub fn recv_protected(&mut self, out: &mut [u8]) -> Result<usize, QdnfError>
Receives a protected frame into out on the primary session.
Sourcepub fn recv_protected_on(
&mut self,
h: SessionHandle,
out: &mut [u8],
) -> Result<usize, QdnfError>
pub fn recv_protected_on( &mut self, h: SessionHandle, out: &mut [u8], ) -> Result<usize, QdnfError>
Receives a protected frame on session h.
Source§impl NativePeer
impl NativePeer
Sourcepub fn independent_bottleneck(&self) -> bool
pub fn independent_bottleneck(&self) -> bool
Default is shared: extra paths do not multiply the bottleneck window.
Sourcepub fn set_independent_bottleneck(&mut self, independent: bool)
pub fn set_independent_bottleneck(&mut self, independent: bool)
Sets independent-bottleneck.
Sourcepub fn set_path_cc_window(&mut self, window_bytes: u64)
pub fn set_path_cc_window(&mut self, window_bytes: u64)
Sets path_cc_window.
Sourcepub fn path_cc_in_flight(&self) -> u64
pub fn path_cc_in_flight(&self) -> u64
NativePeer::path_cc_in_flight.
Sourcepub fn open_extra_path(&mut self) -> Result<PathHandle, QdnfError>
pub fn open_extra_path(&mut self) -> Result<PathHandle, QdnfError>
Open an extra path and attach it to this peer’s congestion table.
Sourcepub fn send_protected_on_path(
&mut self,
path: PathHandle,
dest: &ObservedLocator,
payload: &[u8],
) -> Result<SealedFrame, QdnfError>
pub fn send_protected_on_path( &mut self, path: PathHandle, dest: &ObservedLocator, payload: &[u8], ) -> Result<SealedFrame, QdnfError>
Sends protected traffic on path.
Source§impl NativePeer
impl NativePeer
Sourcepub fn identity(&self) -> ControllerIdentity
pub fn identity(&self) -> ControllerIdentity
NativePeer::identity.
Sourcepub fn locator(&self) -> ObservedLocator
pub fn locator(&self) -> ObservedLocator
Locator.
Sourcepub fn local_link(&self) -> LinkId
pub fn local_link(&self) -> LinkId
NativePeer::local_link.
Sourcepub fn lookup_qsr(
key: &StrongDigest,
covers: &[CoverInterval],
) -> Result<QsrOutcome, QdnfError>
pub fn lookup_qsr( key: &StrongDigest, covers: &[CoverInterval], ) -> Result<QsrOutcome, QdnfError>
Cover-interval membership only. Not authenticated existence.
Use Self::lookup_qsr_full for tokens and handover.
Sourcepub fn lookup_qsr_full(
key: &StrongDigest,
covers: &[CoverInterval],
snapshot: &QsrSnapshot,
required_generation: Generation,
token: Option<TokenStage<'_>>,
handover: Option<HandoverStage<'_>>,
out: &mut [StrongDigest],
) -> Result<QsrOutcome, QdnfError>
pub fn lookup_qsr_full( key: &StrongDigest, covers: &[CoverInterval], snapshot: &QsrSnapshot, required_generation: Generation, token: Option<TokenStage<'_>>, handover: Option<HandoverStage<'_>>, out: &mut [StrongDigest], ) -> Result<QsrOutcome, QdnfError>
Production QSR lookup: exact cover/snapshot, then tokens, then handover.
Sourcepub fn open_session(&mut self, _service: ServiceId) -> Result<(), QdnfError>
pub fn open_session(&mut self, _service: ServiceId) -> Result<(), QdnfError>
Service identifier alone cannot open an application session (E01/R01).
Sourcepub fn neighbor_count(&self) -> usize
pub fn neighbor_count(&self) -> usize
neighbor count.
Auto Trait Implementations§
impl Freeze for NativePeer
impl RefUnwindSafe for NativePeer
impl Send for NativePeer
impl Sync for NativePeer
impl Unpin for NativePeer
impl UnsafeUnpin for NativePeer
impl UnwindSafe for NativePeer
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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