pub struct Overhead { /* private fields */ }Expand description
A layer with bytes of header per SDU and nothing to say in it: what the
driver’s test-only layer-overhead feature configures, so the capability
arithmetic, the floor and the counters pipe are tested without a real
layer. Counts the SDUs it carried as sdus_total.
Implementations§
Trait Implementations§
Source§impl Layer for Overhead
impl Layer for Overhead
Source§fn capabilities(&self, below: &Capabilities) -> Result<Capabilities, LayerError>
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>
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
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 counters(&self) -> Vec<Counter>
fn counters(&self) -> Vec<Counter>
The layer’s counters, every one scoped by this layer’s kind.
Source§fn lanes(&mut self, above: &[LaneKey]) -> Result<Vec<LaneKey>, LayerError>
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>
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>
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 actions(&self) -> Vec<ActionSpec>
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>
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§
impl Freeze for Overhead
impl RefUnwindSafe for Overhead
impl Send for Overhead
impl Sync for Overhead
impl Unpin for Overhead
impl UnsafeUnpin for Overhead
impl UnwindSafe for Overhead
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
Mutably borrows from an owned value. Read more