pub struct SerialTransport { /* private fields */ }Expand description
Frame-oriented Transport over a USB-derived serial endpoint.
Implementations§
Source§impl SerialTransport
impl SerialTransport
Sourcepub fn new(system_name: impl Into<String>, device: impl Into<PathBuf>) -> Self
pub fn new(system_name: impl Into<String>, device: impl Into<PathBuf>) -> Self
Open device on a system_name-tagged transport with the
default baud rate (115200) and 4 MiB max frame size.
Sourcepub fn with_options(
system_name: impl Into<String>,
device: impl Into<PathBuf>,
baud: u32,
max_frame_size: usize,
reconnect_policy: ReconnectPolicy,
) -> Self
pub fn with_options( system_name: impl Into<String>, device: impl Into<PathBuf>, baud: u32, max_frame_size: usize, reconnect_policy: ReconnectPolicy, ) -> Self
Construct with explicit baud, max frame size, and reconnect policy. Baud is ignored for true USB CDC-ACM endpoints (the rate is set by the link, not the user) but retained for true UARTs over USB-to-serial dongles.
Sourcepub fn local_address(&self) -> Option<Address>
pub fn local_address(&self) -> Option<Address>
The local Address returned by listen(). None until then.
Sourcepub fn with_streams<R, W>(
system_name: impl Into<String>,
reader: R,
writer: W,
max_frame_size: usize,
) -> Self
pub fn with_streams<R, W>( system_name: impl Into<String>, reader: R, writer: W, max_frame_size: usize, ) -> Self
Drive the transport over caller-supplied byte-stream halves
instead of opening a serial device. Useful for testing (with
tokio::io::duplex) and for layering the Akka protocol over
custom byte pipes (Unix sockets, SSH-tunneled streams, raw fds
from external tools). No reconnect is attempted; if the streams
close, the transport stays closed until shutdown.
Trait Implementations§
Source§impl Transport for SerialTransport
impl Transport for SerialTransport
Source§fn listen<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn listen<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Address.Source§fn associate<'life0, 'life1, 'async_trait>(
&'life0 self,
_target: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn associate<'life0, 'life1, 'async_trait>(
&'life0 self,
_target: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
target.Source§fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
_target: &'life1 Address,
pdu: AkkaPdu,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
_target: &'life1 Address,
pdu: AkkaPdu,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
target. Implementations are
expected to associate lazily if needed.