pub struct WsConnect { /* private fields */ }Available on crate feature
ws only.Expand description
Simple connection details for a websocket connection.
Implementations§
Source§impl WsConnect
impl WsConnect
Sourcepub fn with_auth(self, auth: Authorization) -> WsConnect
pub fn with_auth(self, auth: Authorization) -> WsConnect
Sets the authorization header.
Sourcepub fn with_auth_opt(self, auth: Option<Authorization>) -> WsConnect
pub fn with_auth_opt(self, auth: Option<Authorization>) -> WsConnect
Sets the optional authorization header.
This replaces the current Authorization.
Sourcepub const fn with_config(self, config: WebSocketConfig) -> WsConnect
pub const fn with_config(self, config: WebSocketConfig) -> WsConnect
Sets the websocket config.
Sourcepub const fn auth(&self) -> Option<&Authorization>
pub const fn auth(&self) -> Option<&Authorization>
Get the authorization header.
Sourcepub const fn config(&self) -> Option<&WebSocketConfig>
pub const fn config(&self) -> Option<&WebSocketConfig>
Get the websocket config.
Sourcepub const fn with_max_retries(self, max_retries: u32) -> WsConnect
pub const fn with_max_retries(self, max_retries: u32) -> WsConnect
Sets the max number of retries before failing and exiting the connection. Default is 10.
Sourcepub const fn with_retry_interval(self, retry_interval: Duration) -> WsConnect
pub const fn with_retry_interval(self, retry_interval: Duration) -> WsConnect
Sets the interval between retries. Default is 3 seconds.
Trait Implementations§
Source§impl IntoClientRequest for WsConnect
impl IntoClientRequest for WsConnect
Source§impl PubSubConnect for WsConnect
impl PubSubConnect for WsConnect
Source§async fn connect(
&self,
) -> Result<ConnectionHandle, RpcError<TransportErrorKind>>
async fn connect( &self, ) -> Result<ConnectionHandle, RpcError<TransportErrorKind>>
Spawn the backend, returning a handle to it. Read more
Source§fn try_reconnect(
&self,
) -> impl Send + Future<Output = Result<ConnectionHandle, RpcError<TransportErrorKind>>>
fn try_reconnect( &self, ) -> impl Send + Future<Output = Result<ConnectionHandle, RpcError<TransportErrorKind>>>
Attempt to reconnect the transport. Read more
Source§fn into_service(
self,
) -> impl Send + Future<Output = Result<PubSubFrontend, RpcError<TransportErrorKind>>>
fn into_service( self, ) -> impl Send + Future<Output = Result<PubSubFrontend, RpcError<TransportErrorKind>>>
Convert the configuration object into a service with a running backend.
Auto Trait Implementations§
impl Freeze for WsConnect
impl RefUnwindSafe for WsConnect
impl Send for WsConnect
impl Sync for WsConnect
impl Unpin for WsConnect
impl UnwindSafe for WsConnect
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 144 bytes