pub struct TransportManager { /* private fields */ }Expand description
Transport manager that routes messages to appropriate transport
Implementations§
Source§impl TransportManager
impl TransportManager
Sourcepub fn new() -> TransportManager
pub fn new() -> TransportManager
Create a manager routing local addresses in-memory and remote addresses over the network transport.
Sourcepub fn send(&self, target: &Address, data: Vec<u8>) -> Result<(), ChannelError>
pub fn send(&self, target: &Address, data: Vec<u8>) -> Result<(), ChannelError>
Send data via the first registered transport supporting target.
§Errors
Returns TransportError::Closed when no transport supports target;
otherwise propagates the selected transport’s send error.
Sourcepub fn recv(&self, source: &Address) -> Result<Vec<u8>, ChannelError>
pub fn recv(&self, source: &Address) -> Result<Vec<u8>, ChannelError>
Receive from the first registered transport supporting source.
§Errors
Returns TransportError::Closed when no transport supports source;
otherwise propagates the selected transport’s receive error.
Trait Implementations§
Source§impl Default for TransportManager
impl Default for TransportManager
Source§fn default() -> TransportManager
fn default() -> TransportManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TransportManager
impl RefUnwindSafe for TransportManager
impl Send for TransportManager
impl Sync for TransportManager
impl Unpin for TransportManager
impl UnsafeUnpin for TransportManager
impl UnwindSafe for TransportManager
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