Struct rsmq_async::Rsmq
source · pub struct Rsmq { /* private fields */ }
Implementations§
source§impl Rsmq
impl Rsmq
sourcepub async fn new(options: RsmqOptions) -> RsmqResult<Rsmq>
pub async fn new(options: RsmqOptions) -> RsmqResult<Rsmq>
Creates a new RSMQ instance, including its connection
sourcepub fn new_with_connection(
connection: MultiplexedConnection,
realtime: bool,
ns: Option<&str>
) -> Rsmq
pub fn new_with_connection( connection: MultiplexedConnection, realtime: bool, ns: Option<&str> ) -> Rsmq
Special method for when you already have a redis-rs connection and you don’t want redis_async to create a new one.
Trait Implementations§
source§impl RsmqConnection for Rsmq
impl RsmqConnection for Rsmq
source§fn change_message_visibility<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
message_id: &'life2 str,
hidden: Duration
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn change_message_visibility<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
message_id: &'life2 str,
hidden: Duration
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Change the hidden time of a already sent message. Read more
source§fn create_queue<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
hidden: Option<Duration>,
delay: Option<Duration>,
maxsize: Option<i32>
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_queue<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
hidden: Option<Duration>,
delay: Option<Duration>,
maxsize: Option<i32>
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new queue. Attributes can be later modified with “set_queue_attributes” method Read more
source§fn delete_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
id: &'life2 str
) -> Pin<Box<dyn Future<Output = RsmqResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
id: &'life2 str
) -> Pin<Box<dyn Future<Output = RsmqResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Deletes a message from the queue. Read more
source§fn delete_queue<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_queue<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes the queue and all the messages on it
source§fn get_queue_attributes<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str
) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_queue_attributes<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str
) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the queue attributes and statistics
source§fn list_queues<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = RsmqResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_queues<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = RsmqResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a list of queues in the namespace
source§fn pop_message<'life0, 'life1, 'async_trait, E>(
&'life0 mut self,
qname: &'life1 str
) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>where
E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pop_message<'life0, 'life1, 'async_trait, E>(
&'life0 mut self,
qname: &'life1 str
) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>where
E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes and returns a message. Be aware that using this you may end with deleted & unprocessed messages.
source§fn receive_message<'life0, 'life1, 'async_trait, E>(
&'life0 mut self,
qname: &'life1 str,
hidden: Option<Duration>
) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>where
E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn receive_message<'life0, 'life1, 'async_trait, E>(
&'life0 mut self,
qname: &'life1 str,
hidden: Option<Duration>
) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>where
E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a message. The message stays hidden for some time (defined by “hidden” argument or the queue
settings). After that time, the message will be redelivered. In order to avoid the redelivery, you need to use
the “delete_message” after this function. Read more
source§fn send_message<'life0, 'life1, 'async_trait, E>(
&'life0 mut self,
qname: &'life1 str,
message: E,
delay: Option<Duration>
) -> Pin<Box<dyn Future<Output = RsmqResult<String>> + Send + 'async_trait>>where
E: 'async_trait + Into<RedisBytes> + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_message<'life0, 'life1, 'async_trait, E>(
&'life0 mut self,
qname: &'life1 str,
message: E,
delay: Option<Duration>
) -> Pin<Box<dyn Future<Output = RsmqResult<String>> + Send + 'async_trait>>where
E: 'async_trait + Into<RedisBytes> + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sends a message to the queue. The message will be delayed some time (controlled by the “delayed” argument or
the queue settings) before being delivered to a client.
source§fn set_queue_attributes<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
hidden: Option<Duration>,
delay: Option<Duration>,
maxsize: Option<i64>
) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_queue_attributes<'life0, 'life1, 'async_trait>(
&'life0 mut self,
qname: &'life1 str,
hidden: Option<Duration>,
delay: Option<Duration>,
maxsize: Option<i64>
) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Modify the queue attributes. Keep in mind that “hidden” and “delay” can be overwritten when the message
is sent. “hidden” can be changed by the method “change_message_visibility” Read more
Auto Trait Implementations§
impl Freeze for Rsmq
impl !RefUnwindSafe for Rsmq
impl Send for Rsmq
impl Sync for Rsmq
impl Unpin for Rsmq
impl !UnwindSafe for Rsmq
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