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
)