pub trait CustomTransport:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn bind(&self) -> Result<Box<dyn CustomEndpoint>>;
}Available on crate feature
unstable-custom-transports only.Expand description
Custom transport.
Usually a transport will only deal with a single custom address type, but the signature allows for dealing with multiple custom address types.
A transport is a factory for custom endpoints. Whenever an iroh endpoint is created using crate::endpoint::Builder::bind, a new custom endpoint will be created using CustomTransport::bind.
Required Methods§
Sourcefn bind(&self) -> Result<Box<dyn CustomEndpoint>>
fn bind(&self) -> Result<Box<dyn CustomEndpoint>>
Create a custom endpoint
Analogously to std::net::UdpSocket::bind, this is where the actual underlying hardware resource is created.
Implementors§
impl CustomTransport for TestTransport
Available on crate features
test-utils only.