Struct misskey_websocket::WebSocketClient
source · [−]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
sourceimpl 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 where
T: TryInto<Url>,
T::Error: Into<Error>,
pub fn builder<T>(url: T) -> WebSocketClientBuilder where
T: TryInto<Url>,
T::Error: Into<Error>,
Creates a new builder instance with url.
All configurations are set to default.
This function is identical to WebSocketClientBuilder::new.
sourcepub fn subnote<E, Id>(
&self,
note_id: Id
) -> BoxFuture<'static, Result<SubNote<E>, Error>> where
E: SubNoteEvent,
Id: Into<String>,
pub fn subnote<E, Id>(
&self,
note_id: Id
) -> BoxFuture<'static, Result<SubNote<E>, Error>> where
E: SubNoteEvent,
Id: Into<String>,
Trait Implementations
sourceimpl Client for WebSocketClient
impl Client for WebSocketClient
sourceimpl Clone for WebSocketClient
impl Clone for WebSocketClient
sourcefn clone(&self) -> WebSocketClient
fn clone(&self) -> WebSocketClient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for WebSocketClient
impl Debug for WebSocketClient
sourceimpl StreamingClient for WebSocketClient
impl StreamingClient for WebSocketClient
sourcefn 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.
sourcefn 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 !RefUnwindSafe for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl !UnwindSafe for WebSocketClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more