Skip to main content

ResponseRoute

Struct ResponseRoute 

Source
pub struct ResponseRoute { /* private fields */ }
Expand description

Saved transport authority and addressing for a response.

Verified direct ingress requires a matching original-socket capability. Missing or mismatched capability fails closed. Router delivery also retains its addressed endpoint and original return port/peer. Clones own neither the router nor a socket and do not extend either lifetime.

Implementations§

Source§

impl ResponseRoute

Source

pub fn new( provenance: TransportProvenance, direct: Option<DirectResponse>, ) -> Self

Capture immutable ingress provenance and its optional direct capability. A supplied capability is checked against provenance at every send.

Source

pub fn unverified() -> Self

Plain, non-direct addressing for locally constructed legacy envelopes.

Source

pub fn provenance(&self) -> TransportProvenance

Original authentication scope; this never follows a replacement peer.

Source

pub fn max_apdu_length( &self, apdu_limit: u16, destination: Option<&NpduAddress>, ) -> Result<u16, Error>

Cap an APDU by the captured router port and direct peer NPDU/BVLC limits, including both source and destination headers actually used by a reply. Ordinary ingress keeps the supplied APDU cap. Invalid authority/addressing is an error; retirement does not invalidate this immutable sizing snapshot.

Source

pub fn requires_direct_response(&self) -> bool

Whether direct-socket authority must be checked, including a malformed context with a missing or mismatched capability.

Source

pub fn requires_original_route(&self) -> bool

Whether response issuance requires captured router or direct authority.

Source

pub fn same_origin(&self, other: &Self) -> bool

Compare the opening transport origin and router endpoint of a request. A later segment cannot switch the addressed endpoint or router instance. Direct capability presence is checked separately at each immediate send; reassembly retains the opening capability for its completed request.

Source

pub fn encode_reply_npdu( &self, apdu: &[u8], destination: Option<&NpduAddress>, expecting_reply: bool, priority: NetworkPriority, ) -> Result<BytesMut, Error>

Encode a response for an immediate MS/TP handoff. This validates all captured authority and router lifetime before returning any bytes. Direct SC responses must use network issuance, never the DER channel.

Trait Implementations§

Source§

impl Clone for ResponseRoute

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResponseRoute

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

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

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

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