pub struct Connection { /* private fields */ }Expand description
Simple RabbitMQ connection wrapper
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn with_config(
config: ConnectionConfig,
) -> Result<Arc<Self>, RustRabbitError>
pub async fn with_config( config: ConnectionConfig, ) -> Result<Arc<Self>, RustRabbitError>
Create a new connection with custom configuration
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if connection is active
Sourcepub async fn create_channel(&self) -> Result<Channel, RustRabbitError>
pub async fn create_channel(&self) -> Result<Channel, RustRabbitError>
Create a new channel
Automatically reconnects if the connection is lost.
Sourcepub async fn reconnect(&self) -> Result<(), RustRabbitError>
pub async fn reconnect(&self) -> Result<(), RustRabbitError>
Manually reconnect
Sourcepub async fn close(&self) -> Result<(), RustRabbitError>
pub async fn close(&self) -> Result<(), RustRabbitError>
Close the connection
Trait Implementations§
Source§impl Debug for Connection
impl Debug for Connection
Auto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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