Skip to main content

OutboxClaim

Struct OutboxClaim 

Source
pub struct OutboxClaim<E> { /* private fields */ }
Expand description

English:
Owned message identifier and event returned by an outbox claim.

Constructing or dropping this container does not reserve, acknowledge, or release a message. Leases, redelivery, and acknowledgement effects are adapter responsibilities.

Split a claim to transfer its identifier and payload independently.

日本語:
アウトボックスの取得操作が返す、所有されたメッセージ識別子とイベントです。

このコンテナーの構築や破棄は、メッセージの予約、確認応答、解放を行いません。 リース、再配信、確認応答の効果はアダプターの責務です。

識別子とペイロードを別々に渡すために取得結果を分解します。

§Example / 使用例

use ddd_toolkit_core::{OutboxClaim, OutboxMessageId};

let claim = OutboxClaim::new(OutboxMessageId::new("message-1"), 42_u32);
assert_eq!(claim.message_id().as_str(), "message-1");
assert_eq!(*claim.event(), 42);
let (id, event) = claim.into_parts();
assert_eq!(id.into_inner(), "message-1");
assert_eq!(event, 42);

Implementations§

Source§

impl<E> OutboxClaim<E>

Source

pub fn new(message_id: OutboxMessageId, event: E) -> OutboxClaim<E>

English:
Pairs message_id with event without contacting an outbox adapter.

日本語:
アウトボックスアダプターにアクセスせず、message_id と event を組にします。

Source

pub fn message_id(&self) -> &OutboxMessageId

English:
Borrows the identifier used to acknowledge this message.

日本語:
このメッセージの確認応答に使う識別子を借用します。

Source

pub fn event(&self) -> &E

English:
Borrows the claimed payload without removing it from this container.

日本語:
このコンテナーから取り出さずに、取得したペイロードを借用します。

Source

pub fn into_parts(self) -> (OutboxMessageId, E)

English:
Consumes the claim and returns the identifier and event without cloning. This does not acknowledge the message.

日本語:
取得結果を消費し、複製せずに識別子とイベントを返します。 この操作はメッセージの確認応答を行いません。

Trait Implementations§

Source§

impl<E> Debug for OutboxClaim<E>
where E: Debug,

Source§

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

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

impl<E> Eq for OutboxClaim<E>
where E: Eq,

Source§

impl<E> PartialEq for OutboxClaim<E>
where E: PartialEq,

Source§

fn eq(&self, other: &OutboxClaim<E>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<E> StructuralPartialEq for OutboxClaim<E>
where E: PartialEq,

Auto Trait Implementations§

§

impl<E> Freeze for OutboxClaim<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for OutboxClaim<E>
where E: RefUnwindSafe,

§

impl<E> Send for OutboxClaim<E>
where E: Send,

§

impl<E> Sync for OutboxClaim<E>
where E: Sync,

§

impl<E> Unpin for OutboxClaim<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for OutboxClaim<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for OutboxClaim<E>
where E: UnwindSafe,

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