Struct siderite::connection::Connection[][src]

pub struct Connection { /* fields omitted */ }

A handle to an active DDP connection.

Implementations

impl Connection[src]

pub async fn connect(url: &str) -> Result<Self>[src]

Create a new connection to the given websocket endpoint. the url parameter is passed as-is to async_tungstenite::tokio

pub async fn connect_with_websocket(
    stream: WebSocketStream<Stream<TokioAdapter<TcpStream>, TokioAdapter<TlsStream<TcpStream>>>>
) -> Result<Self>
[src]

Create a new connection from an existing tungstenite websocket stream.

pub fn stream(&mut self) -> &mut impl Stream<Item = ServerMessage>[src]

Access the inbound stream of messages. Pings are automatically answered, all subscription-related messages will be passed down indiscriminatedly.

pub async fn recv(&mut self) -> Option<ServerMessage>[src]

Convenience method to consume a single message from the inbound stream.

pub fn handle(&self) -> Handle[src]

Acquire a handle that can be used to make RPC calls without borrowing the main connection.

pub async fn call(
    &mut self,
    name: String,
    params: Vec<Value>
) -> Result<MethodResult>
[src]

pub async fn subscribe(
    &mut self,
    id: String,
    name: String,
    params: Vec<Value>
) -> Result<()>
[src]

Subscribe to a collection. You need to provide a unique subscription ID.

pub async fn unsubscribe(&mut self, id: String) -> Result<()>[src]

Unsubscribe from a previously subscribed connection.

Trait Implementations

impl Debug for Connection[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, 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>,