[][src]Struct bitconch_jsonrpc_ws_server::Sender

pub struct Sender { /* fields omitted */ }

Output of WebSocket connection. Use this to send messages to the other endpoint.

Methods

impl Sender[src]

pub fn new(out: Sender, active: Arc<AtomicBool>) -> Self[src]

Creates a new Sender.

pub fn check_active(&self) -> Result<()>[src]

Checks whether connection is still active

pub fn send<M>(&self, msg: M) -> Result<()> where
    M: Into<Message>, 
[src]

Sends a message over the connection. Will return error if the connection is not active any more.

pub fn broadcast<M>(&self, msg: M) -> Result<()> where
    M: Into<Message>, 
[src]

Sends a message over the endpoints of all connections. Will return error if the connection is not active any more.

pub fn close(&self, code: CloseCode) -> Result<()>[src]

Sends a close code to the other endpoint. Will return error if the connection is not active any more.

Trait Implementations

impl Clone for Sender[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Sender

impl Sync for Sender

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T