Struct rsmq_async::Rsmq

source ·
pub struct Rsmq { /* private fields */ }

Implementations§

source§

impl Rsmq

source

pub async fn new(options: RsmqOptions) -> RsmqResult<Rsmq>

Creates a new RSMQ instance, including its connection

source

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 Clone for Rsmq

source§

fn clone(&self) -> Rsmq

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Rsmq

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more