[−][src]Struct lib3h::transport_wss::TransportWss
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]
stream_factory: StreamFactory<T>,
bind: Bind<T>,
tls_config: TlsConfig
) -> Self
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 post(&mut self, command: TransportCommand) -> TransportResult<()>
[src]
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]
&mut self,
id_list: &[&ConnectionIdRef],
payload: &[u8]
) -> TransportResult<()>
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
fn bind(&mut self, url: &Url) -> TransportResult<Url>
[src]
Auto Trait Implementations
impl<T> !Sync for TransportWss<T>
impl<T> !Send for TransportWss<T>
impl<T> Unpin for TransportWss<T> where
T: Unpin,
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]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self