[−][src]Struct misskey_websocket::WebSocketClientBuilder
Builder for WebSocketClient
.
Implementations
impl WebSocketClientBuilder
[src]
pub fn new<T>(url: T) -> Self where
T: TryInto<Url>,
T::Error: Into<Error>,
[src]
T: TryInto<Url>,
T::Error: Into<Error>,
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]
S: AsRef<str>,
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]
S: AsRef<str>,
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]
S1: AsRef<str>,
S2: AsRef<str>,
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]
&mut self,
condition: ReconnectCondition
) -> &mut Self
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]
pub fn clone(&self) -> WebSocketClientBuilder
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WebSocketClientBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for WebSocketClientBuilder
[src]
impl Send for WebSocketClientBuilder
[src]
impl Sync for WebSocketClientBuilder
[src]
impl Unpin for WebSocketClientBuilder
[src]
impl !UnwindSafe for WebSocketClientBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,