[−][src]Struct conec::client::Client
The Client end of a connection to the Coordinator
See library documentation for an example of constructing a Client.
Implementations
impl Client
[src]
pub async fn new(
config: ClientConfig
) -> Result<(Self, IncomingStreams), ClientError>
[src]
config: ClientConfig
) -> Result<(Self, IncomingStreams), ClientError>
Construct a Client and connect to the Coordinator
pub fn new_proxied_stream<T: Into<StreamPeer>>(
&mut self,
to: T
) -> ConnectingOutStream
[src]
&mut self,
to: T
) -> ConnectingOutStream
Open a new stream to another client, proxied through the Coordinator
pub fn new_direct_stream<T: Into<StreamPeer>>(
&mut self,
to: T
) -> ConnectingOutStream
[src]
&mut self,
to: T
) -> ConnectingOutStream
Open a new stream to another client directly
It is only possible to open another stream to a client for which there is an open channel, either because that client connected to this one or because this client called Client::new_channel.
pub fn new_stream_with_id<T: Into<StreamPeer>>(
&self,
to: T,
sid: StreamId
) -> ConnectingOutStream
[src]
&self,
to: T,
sid: StreamId
) -> ConnectingOutStream
Open a new proxied stream to another client with an explicit stream-id
The sid
argument must be different for every call to this function for a given Client object.
If mixing calls to this function with calls to Client::new_proxied_stream or
Client::new_direct_stream, avoid using sid >= 1<<31
, since these values are
used automatically by those functions.
pub fn new_channel(&mut self, to: String) -> ConnectingChannelⓘNotable traits for ConnectingChannel
impl Future for ConnectingChannel type Output = Result<(), NewChannelError>;
[src]
Notable traits for ConnectingChannel
impl Future for ConnectingChannel type Output = Result<(), NewChannelError>;
Open a new channel directly to another client
Note that a client that is not listening for new channels can nevertheless open a new channel to one that is listening.
pub fn new_channel_with_id(&self, to: String, cid: u32) -> ConnectingChannelⓘNotable traits for ConnectingChannel
impl Future for ConnectingChannel type Output = Result<(), NewChannelError>;
[src]
Notable traits for ConnectingChannel
impl Future for ConnectingChannel type Output = Result<(), NewChannelError>;
Open a new channel directly to another client with an explicit channel-id
The cid
argument follows the same rules as the sid
argument to Client::new_stream_with_id.
pub fn close_channel(&self, peer: String) -> ClosingChannelⓘNotable traits for ClosingChannel
impl Future for ClosingChannel type Output = Result<(), ClosingChannelError>;
[src]
Notable traits for ClosingChannel
impl Future for ClosingChannel type Output = Result<(), ClosingChannelError>;
Close an open channel
Currently, attempting to re-open a channel after closing causes what appears to be a transport error. XXX(#1)
pub fn new_broadcast(&mut self, chan: String) -> ConnectingOutStream
[src]
Open or connect to a broadcast stream
A broadcast stream is a many-to-many stream proxied through the Coordinator. Any Client who knows the stream's name can send to and receive from it.
Broadcast streams may suffer from the slow receiver problem: senders cannot make progress until the slowest receiver drains its incoming buffer. The NonblockingInStream adapter may help to address this issue.
pub fn new_broadcast_with_id(
&self,
chan: String,
sid: u32
) -> ConnectingOutStream
[src]
&self,
chan: String,
sid: u32
) -> ConnectingOutStream
Open or connect to a broadcast stream with an explicit stream-id
The sid
argument follows the same rules as the sid
argument to Client::new_stream_with_id.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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,
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, 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,