Skip to main content

QueueService

Struct QueueService 

Source
pub struct QueueService { /* private fields */ }

Implementations§

Source§

impl QueueService

Source

pub async fn new(db_path: &str) -> Result<Self>

Source

pub async fn create_queue(&self, queue_name: &str) -> Result<()>

Source

pub async fn create_queue_with_config(&self, config: &QueueConfig) -> Result<()>

Source

pub async fn send_message( &self, queue_name: &str, body: &str, attributes: Option<HashMap<String, MessageAttributeValue>>, deduplication_id: Option<String>, ) -> Result<String>

Source

pub async fn receive_message( &self, queue_name: &str, ) -> Result<Option<ReceivedMessage>>

Source

pub async fn delete_message(&self, receipt_handle: &str) -> Result<bool>

Source

pub async fn delete_queue(&self, queue_name: &str) -> Result<bool>

Source

pub async fn restore_message(&self, message_id: &str) -> Result<bool>

Source

pub async fn list_queues(&self) -> Result<Vec<(String, String)>>

Source

pub async fn get_queue_attributes( &self, queue_name: &str, ) -> Result<Option<QueueAttributes>>

Source

pub async fn get_queue_messages( &self, queue_name: &str, ) -> Result<Vec<(String, String, String, Option<String>, u32, Option<String>, Option<String>)>>

Source

pub async fn get_all_queue_messages( &self, queue_name: &str, ) -> Result<Vec<(String, String, String, Option<String>, u32, Option<String>, Option<String>, String, Option<String>, Option<String>)>>

Source

pub async fn receive_message_with_dlq( &self, queue_name: &str, ) -> Result<Option<ReceivedMessage>>

Source

pub async fn move_message_to_dlq( &self, message_id: &str, failure_reason: &str, ) -> Result<bool>

Source

pub async fn get_dlq_messages( &self, dlq_name: &str, ) -> Result<Vec<(String, String, String, String, Option<String>)>>

Source

pub async fn redrive_dlq_messages( &self, dlq_name: &str, source_queue: &str, max_messages: Option<u32>, ) -> Result<u32>

Source

pub async fn purge_dlq(&self, dlq_name: &str) -> Result<u32>

Source

pub async fn record_metric( &self, queue_name: &str, metric: &QueueMetric, ) -> Result<()>

Source

pub async fn cleanup_expired_messages( &self, retention_config: &RetentionConfig, ) -> Result<u32>

Source

pub async fn get_queue_config( &self, queue_name: &str, ) -> Result<Option<QueueConfig>>

Source

pub async fn set_queue_attributes( &self, queue_name: &str, attributes: HashMap<String, String>, ) -> Result<()>

Source

pub async fn send_message_enhanced( &self, queue_name: &str, body: &str, attributes: Option<HashMap<String, MessageAttributeValue>>, deduplication_id: Option<String>, delay_seconds: u32, ) -> Result<String>

Source

pub async fn send_message_enhanced_with_group( &self, queue_name: &str, body: &str, attributes: Option<HashMap<String, MessageAttributeValue>>, deduplication_id: Option<String>, delay_seconds: u32, message_group_id: Option<String>, ) -> Result<String>

Source

pub async fn receive_messages_enhanced( &self, queue_name: &str, max_messages: u32, wait_time_seconds: u32, ) -> Result<Vec<ReceivedMessage>>

Source

pub async fn send_messages_batch( &self, entries: Vec<(String, String, String, Option<HashMap<String, MessageAttributeValue>>, Option<String>, u32)>, ) -> Result<Vec<Result<String, String>>>

Source

pub async fn delete_messages_batch( &self, message_ids: Vec<String>, ) -> Result<Vec<Result<bool, String>>>

Source

pub async fn receive_messages_batch( &self, queue_name: &str, max_messages: u32, ) -> Result<Vec<ReceivedMessage>>

Auto Trait Implementations§

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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<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