[][src]Struct lib3h::transport_wss::TransportWss

pub struct TransportWss<T: Read + Write + Debug> { /* fields omitted */ }

A "Transport" implementation based off the websocket protocol any rust io Read/Write stream should be able to serve as the base

Methods

impl TransportWss<TcpStream>[src]

pub fn with_std_tcp_stream(tls_config: TlsConfig) -> Self[src]

convenience constructor for creating a websocket "Transport" instance that is based of the rust std TcpStream

impl<T: Read + Write + Debug + Sized> TransportWss<T>[src]

pub fn new(
    stream_factory: StreamFactory<T>,
    bind: Bind<T>,
    tls_config: TlsConfig
) -> Self
[src]

pub fn wait_connect(&mut self, uri: &Url) -> TransportResult<ConnectionId>[src]

connect and wait for a Connect event response

Trait Implementations

impl<T: Read + Write + Debug> Transport for TransportWss<T>[src]

fn connect(&mut self, uri: &Url) -> TransportResult<ConnectionId>[src]

connect to a remote websocket service

fn close(&mut self, id: &ConnectionIdRef) -> TransportResult<()>[src]

close a currently tracked connection

fn close_all(&mut self) -> TransportResult<()>[src]

close all currently tracked connections

fn connection_id_list(&self) -> TransportResult<Vec<ConnectionId>>[src]

get a list of all open transport ids

fn get_uri(&self, id: &ConnectionIdRef) -> Option<Url>[src]

get uri from a connectionId

fn process(&mut self) -> TransportResult<(DidWork, Vec<TransportEvent>)>[src]

this should be called frequently on the event loop looks for incoming messages or processes ping/pong/close events etc

fn send(
    &mut self,
    id_list: &[&ConnectionIdRef],
    payload: &[u8]
) -> TransportResult<()>
[src]

send a message to one or more remote connected nodes

fn send_all(&mut self, payload: &[u8]) -> TransportResult<()>[src]

send a message to all remote nodes

Auto Trait Implementations

impl<T> !Sync for TransportWss<T>

impl<T> !Send for TransportWss<T>

impl<T> Unpin for TransportWss<T> where
    T: Unpin

impl<T> !RefUnwindSafe for TransportWss<T>

impl<T> !UnwindSafe for TransportWss<T>

Blanket Implementations

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> Same<T> for T

type Output = T

Should always be Self