Skip to main content

Transport

Struct Transport 

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

The single transport connection for a slot.

Implementations§

Source§

impl Transport

Source

pub fn new(tcid: u8) -> Self

New transport for tcid with default timings.

Source

pub fn with_timing(self, poll: Duration, reply: Duration) -> Self

Override the poll interval / reply timeout.

Source

pub fn state(&self) -> TcState

Current connection state.

Source

pub fn init(&mut self) -> Out

Open the connection: emit Create_T_C and arm the reply timeout.

Source

pub fn send_spdu(&mut self, spdu: &[u8]) -> Out

Queue an upper-layer SPDU to send (wrapped in a T_Data_Last). The block is transmitted now if the link is free, else held until the in-flight C_TPDU is answered — one data block per module turn (§A.4 half-duplex).

Source

pub fn tick(&mut self, elapsed: Duration) -> Out

Advance logical time by elapsed: poll if due, or time out a pending reply.

Source

pub fn on_frame(&mut self, frame: &[u8]) -> Out

Handle one link-layer frame read from the device.

A module frame is a leading object (C_T_C_Reply / T_Data_* / …) followed by an appended T_SB, or a standalone T_SB (the reply to a poll with nothing queued). The T_SB’s DA bit drives whether the host must T_RCV next.

Trait Implementations§

Source§

impl Debug for Transport

Source§

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

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

impl Default for Transport

Source§

fn default() -> Self

Returns the “default value” for a type. 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> DescriptorObject for T
where T: Debug + Any + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Borrow as &dyn Any so the caller can downcast to the concrete type.
Source§

impl<T> ExtensionObject for T
where T: Debug + Any + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Borrow as &dyn Any so the caller can downcast to the concrete type.
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> TableObject for T
where T: Debug + Any + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Borrow as &dyn Any so the caller can downcast to the concrete type.
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.