pub struct Handle { /* private fields */ }Expand description
Defines a connection handle for a RabbitMQ cluster, consisting primarily of a set of credentials, along with a bit of metadata for logging/debugging purposes.
This handle by itself does not implement any connection logic.
Implementations§
Source§impl Handle
impl Handle
Sourcepub fn new<H, U, P, VH>(
name: impl AsRef<str>,
chunks: DsnChunks<H, U, P, VH>,
) -> Self
pub fn new<H, U, P, VH>( name: impl AsRef<str>, chunks: DsnChunks<H, U, P, VH>, ) -> Self
Creates a new handle with the given name and composes the DSN from the
given chunks.
Takes care of securing the password against accidental debug-printing.
Ensures proper percent-encoding of the vhost; there is no need to
pre-encode it.
Sourcepub fn with_backoff(self, backoff: BackoffConfig) -> Self
pub fn with_backoff(self, backoff: BackoffConfig) -> Self
Re-create this Handle with the given BackoffConfig.
Source§impl Handle
impl Handle
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Reports the handle identifier, which is the normal connection DSN, but with the password obscured. This identifier is generally safe for debug logging.
Sourcepub fn dsn(&self) -> &SecureString
pub fn dsn(&self) -> &SecureString
Reports the handle DSN.
Sourcepub fn backoff(&self) -> &BackoffConfig
pub fn backoff(&self) -> &BackoffConfig
Exposes the exponential Backoff configuration
for this handle.
Trait Implementations§
Source§impl Debug for Handle
Omits dsn from debug representation. DSN is largely safe (it’s a SecureString),
but its inclusion adds no valuable debug information.
impl Debug for Handle
Omits dsn from debug representation. DSN is largely safe (it’s a SecureString),
but its inclusion adds no valuable debug information.