Struct oracle::aq::MsgProps

source ·
pub struct MsgProps<T>where
    T: Payload + ?Sized,
{ /* private fields */ }
Expand description

Properties of messages that are enqueued and dequeued using advanced queuing

Warning: The type is unstable. It may be changed incompatibly by minor version upgrades.

Implementations§

source§

impl<T> MsgProps<T>where
    T: Payload + ?Sized,

source

pub fn new(conn: &Connection) -> Result<MsgProps<T>>

Creates a new message properties

source

pub fn num_attempts(&self) -> Result<i32>

Returns the number of attempts that have been made to dequeue a message.

source

pub fn correlation(&self) -> Result<String>

Returns the correlation supplied by the producer when the message was enqueued.

source

pub fn delay(&self) -> Result<Duration>

Returns the duration the enqueued message will be delayed.

source

pub fn delivery_mode(&self) -> Result<MessageDeliveryMode>

Returns the mode that was used to deliver the message.

source

pub fn enq_time(&self) -> Result<Timestamp>

Returns the time that the message was enqueued.

source

pub fn exception_queue(&self) -> Result<String>

Returns the name of the queue to which the message is moved if it cannot be processed successfully.

See set_exception_queue method for more information.

source

pub fn expiration(&self) -> Result<Duration>

Returns the duration the message is available to be dequeued.

See set_expiration method for more information.

source

pub fn message_id(&self) -> Result<Vec<u8>>

Returns the id of the message in the queue that generated this message. No value is available until the message has been enqueued or dequeued.

source

pub fn original_message_id(&self) -> Result<Vec<u8>>

Returns the id of the message in the last queue that generated this message.

See set_original_message_id for more information.

source

pub fn payload(&self) -> Result<T::Owned>

Returns the payload associated with the message properties.

The payload is available after the a call to Queue.dequeue or Queue.dequeue_many

source

pub fn priority(&self) -> Result<i32>

Returns the priority assigned to the message.

See set_priority method for more information.

source

pub fn state(&self) -> Result<MessageState>

Returns the state of the message at the time of dequeue.

source

pub fn set_correlation(&mut self, val: &str) -> Result<()>

Sets the correlation of the message to be dequeued.

Special pattern matching characters such as the percent sign (%) and the underscore (_) can be used. If multiple messages satisfy the pattern, the order of dequeuing is undetermined.

source

pub fn set_delay(&mut self, val: &Duration) -> Result<()>

Sets the number of seconds to delay the message before it can be dequeued.

Messages enqueued with a delay are put into the MessageState::Waiting state. When the delay expires the message is put into the MessageState::Ready state. Dequeuing directly by message id overrides this delay specification. Note that delay processing requires the queue monitor to be started.

source

pub fn set_exception_queue(&mut self, val: &str) -> Result<()>

Sets the name of the queue to which the message is moved if it cannot be processed successfully.

Messages are moved if the number of unsuccessful dequeue attempts has reached the maximum allowed number or if the message has expired. All messages in the exception queue are in the MessageState::Expired state.

source

pub fn set_expiration(&mut self, val: &Duration) -> Result<()>

Sets the number of seconds the message is available to be dequeued.

This value is an offset from the delay. Expiration processing requires the queue monitor to be running. Until this time elapses, the messages are in the queue in the state MessageState::Ready. After this time elapses messages are moved to the exception queue in the MessageState::Expired state.

source

pub fn set_original_message_id(&mut self, val: &[u8]) -> Result<()>

Sets the id of the message in the last queue that generated this message.

source

pub fn set_payload(&mut self, val: &T) -> Result<()>

Sets the payload for the message.

This value will be used when the message is enqueued using Queue.enqueue or Queue.enqueue_many.

source

pub fn set_priority(&mut self, val: i32) -> Result<()>

Sets the priority assigned to the message.

A smaller number indicates a higher priority. The priority can be any number, including negative numbers.

Trait Implementations§

source§

impl<T> Clone for MsgProps<T>where
    T: Payload + ?Sized + Clone,

source§

fn clone(&self) -> MsgProps<T>

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<T> Debug for MsgProps<T>where
    T: Payload,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T: ?Sized> RefUnwindSafe for MsgProps<T>where
    T: RefUnwindSafe,

§

impl<T: ?Sized> Send for MsgProps<T>where
    T: Send,

§

impl<T: ?Sized> Sync for MsgProps<T>where
    T: Sync,

§

impl<T: ?Sized> Unpin for MsgProps<T>where
    T: Unpin,

§

impl<T: ?Sized> UnwindSafe for MsgProps<T>where
    T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere
    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 Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.