Struct glimesh::ws::ConnectionBuilder[][src]

pub struct ConnectionBuilder { /* fields omitted */ }

Configure and build a websocket Connection.

Usage:

let connection = Connection::builder()
    .api_url("ws://localhost:8080/api/socket/websocket")
    .build();

Implementations

impl ConnectionBuilder[src]

pub async fn connect(
    self,
    auth: Auth
) -> Result<Connection, WebsocketConnectionError>
[src]

Build the websocket connection from the set options and connect to the socket.

pub fn api_url(self, value: impl Into<String>) -> Self[src]

Set the base api url used for request. Useful if running Glimesh locally for example.

Defaults to wss://glimesh.tv/api/socket/websocket

pub fn version(self, value: impl Into<String>) -> Self[src]

Set the version passed as query param vsn.

This defaults to 2.0.0 and is all glimesh supports at the time of writing.

pub fn outgoing_capacity(self, value: usize) -> Self[src]

Number of messages to buffer before sending messages blocks the sender.

This defaults to 100

pub fn incoming_capacity(self, value: usize) -> Self[src]

Number of messages buffered before older messages a dropped if they aren’t being handled in time.

This defaults to 10_000 to allow for bursts of messages.

pub fn ping_interval(self, value: Duration) -> Self[src]

Number of seconds between each socket ping

This defaults to 30 seconds.

pub fn request_timeout(self, value: Duration) -> Self[src]

How long to wait for a response to a request over the socket before timing out.

This defaults to 30 seconds.

Trait Implementations

impl Debug for ConnectionBuilder[src]

impl Default for ConnectionBuilder[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> Instrument 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, 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>,