pub struct WebSocketClient { /* private fields */ }
Expand description
Asynchronous WebSocket-based client for Misskey.
WebSocketClient
can be constructed using WebSocketClient::connect
or
WebSocketClientBuilder
.
The latter is more flexible and intuitive.
You do not have to wrap this in Arc
and Mutex
to share it because WebSocketClient
is already Clone
and every methods of WebSocketClient
takes &self
, i.e. they does not require mutability.
Implementations§
Source§impl WebSocketClient
impl WebSocketClient
Sourcepub async fn connect(url: Url) -> Result<WebSocketClient, Error>
pub async fn connect(url: Url) -> Result<WebSocketClient, Error>
Connects to Misskey using WebSocket, and returns WebSocketClient
.
Sourcepub async fn connect_with_config(
url: Url,
reconnect_config: ReconnectConfig,
) -> Result<WebSocketClient, Error>
pub async fn connect_with_config( url: Url, reconnect_config: ReconnectConfig, ) -> Result<WebSocketClient, Error>
Connects to Misskey using WebSocket with a given reconnect configuration, and returns WebSocketClient
.
Sourcepub fn builder<T>(url: T) -> WebSocketClientBuilder
pub fn builder<T>(url: T) -> WebSocketClientBuilder
Creates a new builder instance with url
.
All configurations are set to default.
This function is identical to WebSocketClientBuilder::new
.
Trait Implementations§
Source§impl Client for WebSocketClient
impl Client for WebSocketClient
Source§impl Clone for WebSocketClient
impl Clone for WebSocketClient
Source§fn clone(&self) -> WebSocketClient
fn clone(&self) -> WebSocketClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WebSocketClient
impl Debug for WebSocketClient
Source§impl StreamingClient for WebSocketClient
impl StreamingClient for WebSocketClient
Source§fn subnote<E>(
&self,
note_id: String,
) -> BoxFuture<'_, Result<BoxStream<'_, Result<E, Error>>, Error>>where
E: SubNoteEvent,
fn subnote<E>(
&self,
note_id: String,
) -> BoxFuture<'_, Result<BoxStream<'_, Result<E, Error>>, Error>>where
E: SubNoteEvent,
Captures the note specified by
note_id
.Source§fn channel<R>(
&self,
request: R,
) -> BoxFuture<'_, Result<ChannelStream<'_, R, Error>, Error>>where
R: ConnectChannelRequest,
fn channel<R>(
&self,
request: R,
) -> BoxFuture<'_, Result<ChannelStream<'_, R, Error>, Error>>where
R: ConnectChannelRequest,
Connects to the channel using
request
.Auto Trait Implementations§
impl Freeze for WebSocketClient
impl !RefUnwindSafe for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl !UnwindSafe for WebSocketClient
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