[][src]Struct misskey_websocket::WebSocketClientBuilder

pub struct WebSocketClientBuilder { /* fields omitted */ }

Builder for WebSocketClient.

Implementations

impl WebSocketClientBuilder[src]

pub fn new<T>(url: T) -> Self where
    T: TryInto<Url>,
    T::Error: Into<Error>, 
[src]

Creates a new builder instance with url.

All configurations are set to default.

pub fn with_host<S>(host: S) -> Self where
    S: AsRef<str>, 
[src]

Creates a new builder instance with the given host name host.

This method configures the builder with a URL of the form wss://{host}/streaming. All other configurations are set to default.

pub fn token<S>(&mut self, token: S) -> &mut Self where
    S: AsRef<str>, 
[src]

Sets an API token.

This method appends the given token as the i query parameter to the URL.

pub fn query<S1, S2>(&mut self, key: S1, value: S2) -> &mut Self where
    S1: AsRef<str>,
    S2: AsRef<str>, 
[src]

Specifies additional query parameters for the URL.

pub fn auto_reconnect(&mut self, enable: bool) -> &mut Self[src]

Sets whether or not to enable automatic reconnection.

Automatic reconnection is enabled by default (as per Default implementation for ReconnectConfig), and you can disable it with .auto_reconnect(false).

pub fn reconnect_secs(&mut self, secs: u64) -> &mut Self[src]

Sets an interval duration of automatic reconnection in seconds.

pub fn reconnect_interval(&mut self, interval: Duration) -> &mut Self[src]

Sets an interval duration of automatic reconnection.

pub fn reconnect_condition(
    &mut self,
    condition: ReconnectCondition
) -> &mut Self
[src]

Specifies the condition for reconnecting.

pub fn reconnect_retry_send(&mut self, enable: bool) -> &mut Self[src]

Specifies whether to re-send messages that may have failed to be sent when reconnecting.

pub async fn connect<'_>(&'_ self) -> Result<WebSocketClient, Error>[src]

Finish this builder instance and connect to Misskey using this configuration.

Trait Implementations

impl Clone for WebSocketClientBuilder[src]

impl Debug for WebSocketClientBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,