pub struct QueueWrapper { /* private fields */ }Implementations§
Source§impl QueueWrapper
impl QueueWrapper
pub fn new(provider: MqProvider) -> Self
Sourcepub fn with_reconnect(self, policy: ReconnectPolicy) -> Self
pub fn with_reconnect(self, policy: ReconnectPolicy) -> Self
设置重连策略
启用后,publish / consume 在遇到 MqError::Connection 错误时
会按指数退避策略自动重试,最多重试 policy.max_retries 次。
pub async fn publish(&self, topic: &str, message: &[u8]) -> Result<(), MqError>
pub async fn consume(&self, topic: &str) -> Result<Option<Message>, MqError>
pub async fn ack(&self, message_id: &str) -> Result<(), MqError>
pub async fn subscribe(&self, topic: &str) -> Result<(), MqError>
Auto Trait Implementations§
impl !RefUnwindSafe for QueueWrapper
impl !UnwindSafe for QueueWrapper
impl Freeze for QueueWrapper
impl Send for QueueWrapper
impl Sync for QueueWrapper
impl Unpin for QueueWrapper
impl UnsafeUnpin for QueueWrapper
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