pub struct WebsocketStreamsHandle { /* private fields */ }Implementations§
Source§impl WebsocketStreamsHandle
impl WebsocketStreamsHandle
pub fn new(configuration: ConfigurationWebsocketStreams) -> Self
Sourcepub async fn connect(&self) -> Result<WebsocketStreams>
pub async fn connect(&self) -> Result<WebsocketStreams>
Connects to a WebSocket stream using default configuration.
§Returns
A Result containing a WebsocketStreams instance if the connection is successful,
or an error if the connection fails.
§Errors
Returns an anyhow::Error if the connection fails.
§Examples
let handle = WebsocketStreamsHandle::new(configuration);
let streams = handle.connect().await?;
Sourcepub async fn connect_with_config(
&self,
cfg: WebsocketStreamsConnectConfig,
) -> Result<WebsocketStreams>
pub async fn connect_with_config( &self, cfg: WebsocketStreamsConnectConfig, ) -> Result<WebsocketStreams>
Connects to a WebSocket stream with a custom configuration.
§Arguments
cfg- A configuration object specifying connection details for the WebSocket stream.
§Returns
A Result containing a WebsocketStreams instance if the connection is successful,
or an error if the connection fails.
§Errors
Returns an anyhow::Error if the connection fails.
§Examples
let handle = WebsocketStreamsHandle::new(configuration);
let custom_config = WebsocketStreamsConnectConfig::default();
let streams = handle.connect_with_config(custom_config).await?;
Trait Implementations§
Source§impl Clone for WebsocketStreamsHandle
impl Clone for WebsocketStreamsHandle
Source§fn clone(&self) -> WebsocketStreamsHandle
fn clone(&self) -> WebsocketStreamsHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WebsocketStreamsHandle
impl !UnwindSafe for WebsocketStreamsHandle
impl Freeze for WebsocketStreamsHandle
impl Send for WebsocketStreamsHandle
impl Sync for WebsocketStreamsHandle
impl Unpin for WebsocketStreamsHandle
impl UnsafeUnpin for WebsocketStreamsHandle
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