Skip to main content

ShipStack

Struct ShipStack 

Source
pub struct ShipStack {
    pub harbor: Box<dyn HarborLayer>,
    pub tide_pool: Box<dyn TidePoolLayer>,
    pub current: Box<dyn CurrentLayer>,
    pub channel: Box<dyn ChannelLayer>,
    pub beacon: Box<dyn BeaconLayer>,
    pub reef: Box<dyn ReefLayer>,
}
Expand description

A composed stack of all 6 Ship Interconnection Protocol layers.

send routes a message through layers 1 → 6 (bottom-up). receive routes incoming data through layers 6 → 1 (top-down).

Fields§

§harbor: Box<dyn HarborLayer>§tide_pool: Box<dyn TidePoolLayer>§current: Box<dyn CurrentLayer>§channel: Box<dyn ChannelLayer>§beacon: Box<dyn BeaconLayer>§reef: Box<dyn ReefLayer>

Implementations§

Source§

impl ShipStack

Source

pub fn send(&mut self, msg: &[u8]) -> Vec<u8>

Route a message outbound through all 6 layers (L1 → L6).

Each layer may transform the payload; the final bytes are returned.

Source

pub fn receive(&mut self, data: &[u8]) -> Vec<u8>

Route incoming data inbound through all 6 layers (L6 → L1).

Each layer may transform the payload; the final bytes are returned.

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.