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]
stream: WebSocketStream<Stream<TokioAdapter<TcpStream>, TokioAdapter<TlsStream<TcpStream>>>>
) -> Result<Self>
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]
&mut self,
name: String,
params: Vec<Value>
) -> Result<MethodResult>
See Handle::call
pub async fn subscribe(
&mut self,
id: String,
name: String,
params: Vec<Value>
) -> Result<()>
[src]
&mut self,
id: String,
name: String,
params: Vec<Value>
) -> Result<()>
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
Auto Trait Implementations
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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, 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>,