Skip to main content

NativePeer

Struct NativePeer 

Source
pub struct NativePeer { /* private fields */ }

Implementations§

Source§

impl NativePeer

Source

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).

Source

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

Source

pub fn announce( &mut self, dest: &ObservedLocator, now_unix: u64, ) -> Result<(), QdnfError>

QLink beacon announce. Replaces mDNS. Tag is HMAC-bound, not a DID.

Source

pub fn accept_announce(&mut self) -> Result<LinkId, QdnfError>

Accept using now_unix = 1. Callers with a clock use Self::accept_announce_at.

Source

pub fn accept_announce_at(&mut self, now_unix: u64) -> Result<LinkId, QdnfError>

Charge the pre-auth budget, reject expired beacons, then insert only after a locator-bound challenge. Link possession is not DID authority.

Source§

impl NativePeer

Source

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.

Source

pub fn close_session(&mut self, h: SessionHandle) -> Result<(), QdnfError>

Closes session h; QdnfError on unknown/invalid handle.

Source

pub fn live_session_count(&self) -> usize

Number of live sessions.

Source

pub fn remaining_host_bytes(&self) -> u64

Remaining host byte budget.

Source

pub fn primary_session(&self) -> Option<SessionHandle>

The primary session handle, if any.

Source

pub fn cancel(&mut self) -> Result<CancelEpoch, QdnfError>

Cancel in-flight send/recv. Does not commit application offsets.

Source

pub fn rekey_protected( &mut self, table: &mut RekeyTable, ) -> Result<u64, QdnfError>

Traffic-secret update. Does not mint a new permit or grant.

Source

pub fn network_pass(&mut self, charge: PassCharge) -> Result<u64, QdnfError>

Charge one Sentinel network pass (accounting only; no 42 MiB map).

Source

pub fn send_stream( &mut self, dest: &ObservedLocator, payload: &[u8], ) -> Result<usize, QdnfError>

Sends stream bytes on the primary session.

Source

pub fn recv_stream(&mut self, out: &mut [u8]) -> Result<usize, QdnfError>

Receives stream bytes into out; returns bytes read.

Source

pub fn send_protected( &mut self, dest: &ObservedLocator, payload: &[u8], ) -> Result<SealedFrame, QdnfError>

Sends a protected frame on the primary session.

Source

pub fn send_protected_on( &mut self, h: SessionHandle, dest: &ObservedLocator, payload: &[u8], ) -> Result<SealedFrame, QdnfError>

Sends a protected frame on session h.

Source

pub fn recv_protected(&mut self, out: &mut [u8]) -> Result<usize, QdnfError>

Receives a protected frame into out on the primary session.

Source

pub fn recv_protected_on( &mut self, h: SessionHandle, out: &mut [u8], ) -> Result<usize, QdnfError>

Receives a protected frame on session h.

Source

pub fn poll_recv( &mut self, now_unix: u64, deadline_unix: u64, out: &mut [u8], ) -> Result<usize, QdnfError>

Poll until deadline_unix. Empty queue before the deadline is WouldBlock; at/after the deadline with nothing is Expired.

Source§

impl NativePeer

Source

pub fn independent_bottleneck(&self) -> bool

Default is shared: extra paths do not multiply the bottleneck window.

Source

pub fn set_independent_bottleneck(&mut self, independent: bool)

Sets independent-bottleneck.

Source

pub fn set_path_cc_window(&mut self, window_bytes: u64)

Sets path_cc_window.

Source

pub fn path_cc_in_flight(&self) -> u64

NativePeer::path_cc_in_flight.

Source

pub fn open_extra_path(&mut self) -> Result<PathHandle, QdnfError>

Open an extra path and attach it to this peer’s congestion table.

Source

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

Source

pub fn identity(&self) -> ControllerIdentity

NativePeer::identity.

Source

pub fn locator(&self) -> ObservedLocator

Locator.

NativePeer::local_link.

Source

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.

Source

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.

Source

pub fn open_session(&mut self, _service: ServiceId) -> Result<(), QdnfError>

Service identifier alone cannot open an application session (E01/R01).

Source

pub fn neighbor_count(&self) -> usize

neighbor count.

Auto Trait Implementations§

Blanket Implementations§

§

impl<S, A> Aggregate<Result<S, Error>> for A
where A: Aggregate<S>,

§

fn from_shares<T>(iter: T) -> Result<A, Error>
where T: IntoIterator<Item = Result<S, Error>>,

Aggregate shares in an MPC protocol.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more