[−][src]Struct libp2p_websocket::WsConfig
A Websocket transport.
Methods
impl<T> WsConfig<T>
[src]
pub fn new(transport: T) -> Self
[src]
Create a new websocket transport based on the given transport.
pub fn max_redirects(&self) -> u8
[src]
Return the configured maximum number of redirects.
pub fn set_max_redirects(&mut self, max: u8) -> &mut Self
[src]
Set max. number of redirects to follow.
pub fn max_data_size(&self) -> u64
[src]
Get the max. frame data size we support.
pub fn set_max_data_size(&mut self, size: u64) -> &mut Self
[src]
Set the max. frame data size we support.
pub fn set_tls_config(&mut self, c: Config) -> &mut Self
[src]
Set the TLS configuration if TLS support is desired.
Trait Implementations
impl<T: Clone> Clone for WsConfig<T>
[src]
fn clone(&self) -> WsConfig<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> From<WsConfig<T>> for WsConfig<T>
[src]
impl<T: Debug> Debug for WsConfig<T>
[src]
impl<T> Transport for WsConfig<T> where
T: Transport + Send + Clone + 'static,
T::Error: Send + 'static,
T::Dial: Send + 'static,
T::Listener: Send + 'static,
T::ListenerUpgrade: Send + 'static,
T::Output: AsyncRead + AsyncWrite + Send + 'static,
[src]
T: Transport + Send + Clone + 'static,
T::Error: Send + 'static,
T::Dial: Send + 'static,
T::Listener: Send + 'static,
T::ListenerUpgrade: Send + 'static,
T::Output: AsyncRead + AsyncWrite + Send + 'static,
type Output = RwStreamSink<BytesConnection<T::Output>>
The result of a connection setup process, including protocol upgrades. Read more
type Error = Error<T::Error>
An error that occurred during connection setup.
type Listener = MapStream<InnerStream<T::Output, T::Error>, WrapperFn<T::Output>>
A stream of Output
s for inbound connections. Read more
type ListenerUpgrade = MapFuture<InnerFuture<T::Output, T::Error>, WrapperFn<T::Output>>
A pending Output
for an inbound connection, obtained from the Listener
stream. Read more
type Dial = MapFuture<InnerFuture<T::Output, T::Error>, WrapperFn<T::Output>>
A pending Output
for an outbound connection, obtained from dialing. Read more
fn listen_on(
self,
addr: Multiaddr
) -> Result<Self::Listener, TransportError<Self::Error>>
[src]
self,
addr: Multiaddr
) -> Result<Self::Listener, TransportError<Self::Error>>
fn dial(
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
[src]
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
fn boxed(self) -> Boxed<Self::Output, Self::Error> where
Self: Clone + Send + Sync + 'static,
Self::Dial: Send,
Self::Dial: 'static,
Self::Listener: Send,
Self::Listener: 'static,
Self::ListenerUpgrade: Send,
Self::ListenerUpgrade: 'static,
[src]
Self: Clone + Send + Sync + 'static,
Self::Dial: Send,
Self::Dial: 'static,
Self::Listener: Send,
Self::Listener: 'static,
Self::ListenerUpgrade: Send,
Self::ListenerUpgrade: 'static,
Turns this Transport
into an abstract boxed transport.
fn map<F, O>(self, map: F) -> Map<Self, F> where
F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone,
[src]
F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone,
Applies a function on the connections created by the transport.
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> TNewErr + Clone,
[src]
F: FnOnce(Self::Error) -> TNewErr + Clone,
Applies a function on the errors generated by the futures of the transport.
fn or_transport<T>(self, other: T) -> OrTransport<Self, T>
[src]
Builds a new transport that falls back to another transport when encountering errors on dialing or listening for connections. Read more
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where
U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
Self::Output: AsyncRead,
Self::Output: AsyncWrite,
[src]
U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
Self::Output: AsyncRead,
Self::Output: AsyncWrite,
Wraps this transport inside an [Upgrade
]. Read more
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
F: IntoFuture<Item = O>,
[src]
C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
F: IntoFuture<Item = O>,
Applies a function producing an asynchronous result to every connection created by this transport. Read more
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self>
[src]
Adds a timeout to the connection setup (including upgrades) for all inbound and outbound connection attempts. Read more
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>
[src]
Adds a timeout to the connection setup (including upgrades) for all outbound connection attempts. Read more
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>
[src]
Adds a timeout to the connection setup (including upgrades) for all inbound connection attempts. Read more
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self