pub struct WsConfig { /* private fields */ }
Expand description
A Websocket transport whose output type is a Stream
and Sink
of
frame payloads which does not implement AsyncRead
or
AsyncWrite
. See crate::WsConfig
if you require the latter.
Implementations§
Source§impl WsConfig
impl WsConfig
Sourcepub fn new(transport: ITransport<TcpTransStream>) -> Self
pub fn new(transport: ITransport<TcpTransStream>) -> Self
Create a new websocket transport based on another transport.
Trait Implementations§
Source§impl Transport for WsConfig
impl Transport for WsConfig
Source§type Output = Connection<EitherOutput<EitherOutput<TlsClientStream<TcpTransStream>, TlsServerStream<TcpTransStream>>, TcpTransStream>>
type Output = Connection<EitherOutput<EitherOutput<TlsClientStream<TcpTransStream>, TlsServerStream<TcpTransStream>>, TcpTransStream>>
The result of a connection setup process, including protocol upgrades. Read more
Source§fn listen_on(
&mut self,
addr: Multiaddr,
) -> Result<IListener<Self::Output>, TransportError>
fn listen_on( &mut self, addr: Multiaddr, ) -> Result<IListener<Self::Output>, TransportError>
Source§fn dial<'life0, 'async_trait>(
&'life0 mut self,
addr: Multiaddr,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dial<'life0, 'async_trait>(
&'life0 mut self,
addr: Multiaddr,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn box_clone(&self) -> ITransport<Self::Output>
fn box_clone(&self) -> ITransport<Self::Output>
Clones the transport and returns the trait object.
Source§fn timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
fn timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
Adds a timeout to the connection setup (including upgrades) for all
inbound and outbound connections established through the transport.
Source§fn outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
fn outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
Adds a timeout to the connection setup (including upgrades) for all outbound
connections established through the transport.
Source§fn inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
fn inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
Adds a timeout to the connection setup (including upgrades) for all inbound
connections established through the transport.
Auto Trait Implementations§
impl Freeze for WsConfig
impl !RefUnwindSafe for WsConfig
impl Send for WsConfig
impl !Sync for WsConfig
impl Unpin for WsConfig
impl !UnwindSafe for WsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more