Skip to main content

Identity

Struct Identity 

Source
pub struct Identity;
Expand description

A layer that changes nothing: the kit’s positive control, and what the driver’s Stack is held to in the medium kit’s decorator check.

Trait Implementations§

Source§

impl Debug for Identity

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Identity

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Layer for Identity

Source§

fn kind(&self) -> &'static str

The name the file and the counters use: "aead", "fragment".
Source§

fn capabilities(&self, below: &Capabilities) -> Result<Capabilities, LayerError>

What this layer makes of the capabilities below it: the overhead taken off each direction, reliable as the layer’s rule says, the framing it adds or passes through. Refused when nothing would fit or the layer below cannot be layered over.
Source§

fn encode( &mut self, lane: &LaneKey, sdu: Sdu, _now: Instant, out: &mut Frames, ) -> Result<(), LayerError>

One SDU going down: the frames for the layer below, in order, pushed onto out.
Source§

fn decode( &mut self, lane: &LaneKey, frame: Sdu, _now: Instant, out: &mut Frames, ) -> Decoded

One frame coming up: the SDUs for the layer above pushed onto out, or a counted refusal.
Source§

fn lanes(&mut self, above: &[LaneKey]) -> Result<Vec<LaneKey>, LayerError>

The lanes to ask of the layer below, given the lanes asked of this one. Identity for most layers; an addressing layer maps a lane per peer onto one channel. Called once, before anything moves.
Source§

fn tick( &mut self, now: Instant, down: &mut Frames, up: &mut Frames, ) -> Option<Instant>

Time passing: what the layer’s timers owe downward (down, as frames for the layer below) and upward (up, as SDUs for the layer above), and when it next needs a tick. None when nothing is pending.
Source§

fn security( &self, below: Option<&SecurityProperties>, ) -> Option<SecurityProperties>

What this layer guarantees about the bytes it carries, given what the layers below guarantee (I6). A layer that adds nothing passes below through.
Source§

fn counters(&self) -> Vec<Counter>

The layer’s counters, every one scoped by this layer’s kind.
Source§

fn actions(&self) -> Vec<ActionSpec>

The operator actions this layer offers (#129), if any: a key rotation, for one.
Source§

fn invoke( &mut self, name: &str, arguments: &BTreeMap<String, ConfigValue>, ) -> Result<ActionOutcome, ActionError>

Run one of them, now. Synchronous, like everything here.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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