pub trait SessionInboxPort: Send + Sync {
// Required methods
fn deliver<'life0, 'life1, 'async_trait>(
&'life0 self,
envelope: &'life1 SessionMessageEnvelope,
) -> Pin<Box<dyn Future<Output = Result<SessionInboxReceipt, SessionInboxError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn mark_activation_eligible<'life0, 'life1, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
generation: u64,
policy: SessionActivationPolicy,
) -> Pin<Box<dyn Future<Output = Result<(), SessionInboxError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn claim<'life0, 'life1, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionInboxClaim>, SessionInboxError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn was_admitted<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
id: &'life2 SessionMessageId,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionInboxError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn ack<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
claim: &'life2 SessionInboxClaim,
) -> Pin<Box<dyn Future<Output = Result<(), SessionInboxError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn inspect<'life0, 'life1, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SessionInboxBacklog, SessionInboxError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
Durable delivery/claim/ack port. Implementations are scoped to one runtime, but every address is a stable logical session id.
Required Methods§
fn deliver<'life0, 'life1, 'async_trait>(
&'life0 self,
envelope: &'life1 SessionMessageEnvelope,
) -> Pin<Box<dyn Future<Output = Result<SessionInboxReceipt, SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn mark_activation_eligible<'life0, 'life1, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
generation: u64,
policy: SessionActivationPolicy,
) -> Pin<Box<dyn Future<Output = Result<(), SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn mark_activation_eligible<'life0, 'life1, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
generation: u64,
policy: SessionActivationPolicy,
) -> Pin<Box<dyn Future<Output = Result<(), SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Durably authorize execution for the queue prefix through generation.
This is separate from deliver so orchestration
producers can stage outcomes without violating a persisted wait policy.
Implementations must make this monotonic and idempotent.
fn claim<'life0, 'life1, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionInboxClaim>, SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn was_admitted<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
id: &'life2 SessionMessageId,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn was_admitted<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
id: &'life2 SessionMessageId,
) -> Pin<Box<dyn Future<Output = Result<bool, SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Permanent durable receipt check. Unlike the bounded in-session cursor, this tombstone must remain true for the lifetime of the logical inbox.
Sourcefn ack<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
claim: &'life2 SessionInboxClaim,
) -> Pin<Box<dyn Future<Output = Result<(), SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn ack<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
claim: &'life2 SessionInboxClaim,
) -> Pin<Box<dyn Future<Output = Result<(), SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Persist the permanent admitted-id receipt, then remove the claimed queue item. Callers may invoke this only after the transcript checkpoint containing the same id is durable.
fn inspect<'life0, 'life1, 'async_trait>(
&'life0 self,
target_session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SessionInboxBacklog, SessionInboxError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".