pub struct DefaultTransport { /* private fields */ }Expand description
A high-level wrapper around a low-level DynTxImp transport implementation.
Implementations§
Source§impl DefaultTransport
impl DefaultTransport
Sourcepub fn create(hnd: &TxImpHnd, imp: DynTxImp) -> DynTransport
pub fn create(hnd: &TxImpHnd, imp: DynTxImp) -> DynTransport
When constructing a Transport from a TransportFactory, this function does the actual wrapping of your implemementation to produce the Transport struct.
DefaultTransport is built to be used with the provided TxImpHnd.
Trait Implementations§
Source§impl Clone for DefaultTransport
impl Clone for DefaultTransport
Source§fn clone(&self) -> DefaultTransport
fn clone(&self) -> DefaultTransport
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultTransport
impl Debug for DefaultTransport
Source§impl Transport for DefaultTransport
impl Transport for DefaultTransport
Source§fn register_space_handler(
&self,
space: SpaceId,
handler: DynTxSpaceHandler,
) -> Option<Url>
fn register_space_handler( &self, space: SpaceId, handler: DynTxSpaceHandler, ) -> Option<Url>
Register a space handler for receiving incoming notifications. Read more
Source§fn register_module_handler(
&self,
space: SpaceId,
module: String,
handler: DynTxModuleHandler,
)
fn register_module_handler( &self, space: SpaceId, module: String, handler: DynTxModuleHandler, )
Register a module handler for receiving incoming module messages. Read more
Source§fn disconnect(&self, peer: Url, reason: Option<String>) -> BoxFut<'_, ()>
fn disconnect(&self, peer: Url, reason: Option<String>) -> BoxFut<'_, ()>
Make a best effort to notify a peer that we are disconnecting and why.
After a short time out, the connection will be closed even if the
disconnect reason message is still pending.
Source§fn send_space_notify(
&self,
peer: Url,
space: SpaceId,
data: Bytes,
) -> BoxFut<'_, K2Result<()>>
fn send_space_notify( &self, peer: Url, space: SpaceId, data: Bytes, ) -> BoxFut<'_, K2Result<()>>
Notify a remote peer within a space. This is a fire-and-forget
type message. The future this call returns will indicate any errors
that occur up to the point where the message is handed off to
the transport backend. After that, the future will return
Ok(())
but the remote peer may or may not actually receive the message.Source§fn send_module(
&self,
peer: Url,
space: SpaceId,
module: String,
data: Bytes,
) -> BoxFut<'_, K2Result<()>>
fn send_module( &self, peer: Url, space: SpaceId, module: String, data: Bytes, ) -> BoxFut<'_, K2Result<()>>
Notify a remote peer module within a space. This is a fire-and-forget
type message. The future this call returns will indicate any errors
that occur up to the point where the message is handed off to
the transport backend. After that, the future will return
Ok(())
but the remote peer may or may not actually receive the message.Source§fn dump_network_stats(&self) -> BoxFut<'_, K2Result<TransportStats>>
fn dump_network_stats(&self) -> BoxFut<'_, K2Result<TransportStats>>
Dump network stats.
Auto Trait Implementations§
impl Freeze for DefaultTransport
impl !RefUnwindSafe for DefaultTransport
impl Send for DefaultTransport
impl Sync for DefaultTransport
impl Unpin for DefaultTransport
impl !UnwindSafe for DefaultTransport
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