pub struct WsConnect {
pub url: String,
pub auth: Option<Authorization>,
pub config: Option<WebSocketConfig>,
}
Available on crate feature
ws
only.Expand description
Simple connection details for a websocket connection.
Fields§
§url: String
The URL to connect to.
auth: Option<Authorization>
The authorization header to use.
config: Option<WebSocketConfig>
The websocket config.
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 const fn with_config(self, config: WebSocketConfig) -> WsConnect
pub const fn with_config(self, config: WebSocketConfig) -> WsConnect
Sets the websocket config.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> 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