pub struct Client { /* private fields */ }
Expand description
A client containing an authenticated connection to either Selium Cloud
or a self-hosted Selium
server.
The Client struct is the entry point to opening various Selium
streams, such as the
Pub/Sub streams and Request/Reply streams.
Multiple streams can be opened from a single connected Client without extinguishing the underlying connection, through the use of QUIC multiplexing.
NOTE: The Client struct should never be used directly, and is intended to be constructed by a
ClientBuilder, following a successfully established connection to the Selium
server.
Implementations§
source§impl Client
impl Client
sourcepub fn subscriber(&self, topic: &str) -> StreamBuilder<SubscriberWantsDecoder>
pub fn subscriber(&self, topic: &str) -> StreamBuilder<SubscriberWantsDecoder>
Returns a new StreamBuilder instance, with an initial Subscriber
state.
sourcepub fn publisher(&self, topic: &str) -> StreamBuilder<PublisherWantsEncoder>
pub fn publisher(&self, topic: &str) -> StreamBuilder<PublisherWantsEncoder>
Returns a new StreamBuilder instance, with an initial Publisher
state.
sourcepub fn replier(
&self,
endpoint: &str
) -> StreamBuilder<ReplierWantsRequestDecoder>
pub fn replier( &self, endpoint: &str ) -> StreamBuilder<ReplierWantsRequestDecoder>
Returns a new StreamBuilder instance, with an initial Replier
state.
sourcepub fn requestor(
&self,
endpoint: &str
) -> StreamBuilder<RequestorWantsRequestEncoder>
pub fn requestor( &self, endpoint: &str ) -> StreamBuilder<RequestorWantsRequestEncoder>
Returns a new StreamBuilder instance, with an initial Requestor
state.