Skip to main content

IsoTpAsyncNode

Struct IsoTpAsyncNode 

Source
pub struct IsoTpAsyncNode<'a, Tx, Rx, F, C>
where Tx: AsyncTxFrameIo<Frame = F>, Rx: AsyncRxFrameIo<Frame = F, Error = Tx::Error>, C: Clock,
{ /* private fields */ }
Expand description

Async ISO-TP endpoint backed by async transmit/receive halves and a clock.

Implementations§

Source§

impl<'a, Tx, Rx, F, C> IsoTpAsyncNode<'a, Tx, Rx, F, C>
where Tx: AsyncTxFrameIo<Frame = F>, Rx: AsyncRxFrameIo<Frame = F, Error = Tx::Error>, F: Frame, C: Clock,

Source

pub fn builder( tx: Tx, rx: Rx, cfg: IsoTpConfig, clock: C, ) -> IsoTpAsyncNodeBuilder<Tx, Rx, C>

Start building an IsoTpAsyncNode (requires RX storage before build()).

Source

pub fn with_clock( tx: Tx, rx: Rx, cfg: IsoTpConfig, clock: C, rx_buffer: &'a mut [u8], ) -> Result<Self, IsoTpError<()>>

Construct using a provided clock and caller-provided RX buffer.

Source

pub fn with_clock_and_storage( tx: Tx, rx: Rx, cfg: IsoTpConfig, clock: C, rx_storage: RxStorage<'a>, ) -> Result<Self, IsoTpError<()>>

Construct using a provided clock and explicit RX storage.

Source

pub fn rx_flow_control(&self) -> RxFlowControl

Get the current receive-side FlowControl parameters (BS/STmin).

Source

pub fn set_rx_flow_control(&mut self, fc: RxFlowControl)

Update receive-side FlowControl parameters (BS/STmin).

Source

pub async fn send<R: AsyncRuntime>( &mut self, rt: &R, payload: &[u8], timeout: Duration, ) -> Result<(), IsoTpError<Tx::Error>>

Blocking-by-await send until completion or timeout.

This method performs the full ISO-TP handshake and segmentation as needed, using the provided runtime for sleeps/timeouts.

Source

pub async fn recv<R: AsyncRuntime>( &mut self, rt: &R, timeout: Duration, deliver: &mut dyn FnMut(&[u8]), ) -> Result<(), IsoTpError<Tx::Error>>

Blocking-by-await receive until a full payload arrives or timeout.

The provided deliver callback is invoked only when a full payload has been reassembled. The slice passed to deliver is valid until the next receive operation mutates the internal reassembly buffer.

Source§

impl<'a, Tx, Rx, F> IsoTpAsyncNode<'a, Tx, Rx, F, StdClock>
where Tx: AsyncTxFrameIo<Frame = F>, Rx: AsyncRxFrameIo<Frame = F, Error = Tx::Error>, F: Frame,

Source

pub fn with_std_clock( tx: Tx, rx: Rx, cfg: IsoTpConfig, rx_buffer: &'a mut [u8], ) -> Result<Self, IsoTpError<()>>

Convenience constructor using StdClock.

Auto Trait Implementations§

§

impl<'a, Tx, Rx, F, C> Freeze for IsoTpAsyncNode<'a, Tx, Rx, F, C>
where Tx: Freeze, Rx: Freeze, C: Freeze, <C as Clock>::Instant: Freeze,

§

impl<'a, Tx, Rx, F, C> RefUnwindSafe for IsoTpAsyncNode<'a, Tx, Rx, F, C>

§

impl<'a, Tx, Rx, F, C> Send for IsoTpAsyncNode<'a, Tx, Rx, F, C>
where Tx: Send, Rx: Send, C: Send, <C as Clock>::Instant: Send,

§

impl<'a, Tx, Rx, F, C> Sync for IsoTpAsyncNode<'a, Tx, Rx, F, C>
where Tx: Sync, Rx: Sync, C: Sync, <C as Clock>::Instant: Sync,

§

impl<'a, Tx, Rx, F, C> Unpin for IsoTpAsyncNode<'a, Tx, Rx, F, C>
where Tx: Unpin, Rx: Unpin, C: Unpin, <C as Clock>::Instant: Unpin,

§

impl<'a, Tx, Rx, F, C> UnsafeUnpin for IsoTpAsyncNode<'a, Tx, Rx, F, C>

§

impl<'a, Tx, Rx, F, C> !UnwindSafe for IsoTpAsyncNode<'a, Tx, Rx, F, C>

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.