Skip to main content

ClaimCheckRepository

Trait ClaimCheckRepository 

Source
pub trait ClaimCheckRepository:
    Send
    + Sync
    + Debug
    + 'static {
    // Required methods
    fn name(&self) -> &str;
    fn set<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        payload: Message,
    ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Message, CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_and_remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Message, CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn push<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        payload: Message,
    ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn pop<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Message, CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Pluggable payload store for the Claim Check EIP.

Stashes large message payloads by key so the Exchange carries only a lightweight reference (the key). Supports single-value keys and LIFO stacks (for push/pop operations).

§Contract (C1)

  • set stores or overwrites a payload by key.
  • get returns a clone of the payload without removing it. Returns an error if the key does not exist.
  • get_and_remove returns and removes in one atomic step.
  • remove succeeds even if the key does not exist (no-op).
  • push appends to a LIFO stack for the given key.
  • pop removes and returns the top of the LIFO stack. Returns an error if the stack is empty.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name for diagnostics.

Source

fn set<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, payload: Message, ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store payload under key. Overwrites any existing value.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Message, CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve payload by key without removing it.

Returns an error if the key does not exist.

Source

fn get_and_remove<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Message, CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve and remove in one atomic step.

Returns an error if the key does not exist.

Source

fn remove<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove payload by key. Succeeds even if the key does not exist.

Source

fn push<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, payload: Message, ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Push payload onto a LIFO stack for key.

Source

fn pop<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Message, CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Pop payload from a LIFO stack for key.

Returns an error if the stack is empty.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§