pub struct Client<T> {
pub configuration: Configuration,
/* private fields */
}Expand description
the Client structures connects to a server and creates channels
Fields§
§configuration: ConfigurationImplementations§
Source§impl<T> Client<T>
impl<T> Client<T>
Sourcepub fn connect(
stream: T,
options: ConnectionOptions,
) -> impl Future<Item = (Client<T>, Heartbeat<impl Future<Item = (), Error = Error> + Send + 'static>), Error = Error> + Send + 'static
pub fn connect( stream: T, options: ConnectionOptions, ) -> impl Future<Item = (Client<T>, Heartbeat<impl Future<Item = (), Error = Error> + Send + 'static>), Error = Error> + Send + 'static
Takes a stream (TCP, TLS, unix socket, etc) and uses it to connect to an AMQP server.
This function returns a future that resolves once the connection handshake is done.
The result is a tuple containing a Client that can be used to create Channels and a
Heartbeat instance. The heartbeat is a task (it implements Future) that should be
spawned independently of the other futures.
To stop the heartbeat task, see HeartbeatHandle.
Sourcepub fn create_channel(
&self,
) -> impl Future<Item = Channel<T>, Error = Error> + Send + 'static
pub fn create_channel( &self, ) -> impl Future<Item = Channel<T>, Error = Error> + Send + 'static
creates a new channel
returns a future that resolves to a Channel once the method succeeds
Sourcepub fn create_confirm_channel(
&self,
options: ConfirmSelectOptions,
) -> impl Future<Item = Channel<T>, Error = Error> + Send + 'static
pub fn create_confirm_channel( &self, options: ConfirmSelectOptions, ) -> impl Future<Item = Channel<T>, Error = Error> + Send + 'static
returns a future that resolves to a Channel once the method succeeds
the channel will support RabbitMQ’s confirm extension
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Client<T>
impl<T> !RefUnwindSafe for Client<T>
impl<T> Send for Client<T>where
T: Send,
impl<T> Sync for Client<T>where
T: Send,
impl<T> Unpin for Client<T>
impl<T> !UnwindSafe for Client<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more