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

Connects to Misskey using WebSocket, and returns WebSocketClient.

Connects to Misskey using WebSocket with a given reconnect configuration, and returns WebSocketClient.

Creates a new builder instance with url. All configurations are set to default.

This function is identical to WebSocketClientBuilder::new.

Captures the note specified by id.

The returned SubNote implements Stream so that note events can be retrieved asynchronously via it.

Connects to the channel using request.

The returned Channel implements Stream and Sink so that you can exchange messages with channels on it.

Receive messages from the broadcast stream.

The returned Broadcast implements Stream so that broadcast events can be retrieved asynchronously via it.

Trait Implementations

The error type produced by the client when an error occurs.

Dispatch an API request. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The error type produced by the client when an error occurs.

Captures the note specified by note_id.

Connects to the channel using request.

Receive messages from the broadcast stream.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.