pub struct InMemoryCommandRegistry { /* private fields */ }Expand description
In-memory implementation for tests and local development.
Tracks command metadata in memory. Configurable deployment model (defaults to Pull).
Implementations§
Source§impl InMemoryCommandRegistry
impl InMemoryCommandRegistry
Sourcepub fn with_deployment_model(deployment_model: DeploymentModel) -> Self
pub fn with_deployment_model(deployment_model: DeploymentModel) -> Self
Create a new in-memory registry with the specified deployment model.
Sourcepub async fn list_command_ids(&self) -> Vec<String>
pub async fn list_command_ids(&self) -> Vec<String>
List all command IDs (useful for debugging/testing)
Trait Implementations§
Source§impl CommandRegistry for InMemoryCommandRegistry
impl CommandRegistry for InMemoryCommandRegistry
Source§fn create_command<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
deployment_id: &'life1 str,
command_name: &'life2 str,
initial_state: CommandState,
deadline: Option<DateTime<Utc>>,
request_size_bytes: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<CommandMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_command<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
deployment_id: &'life1 str,
command_name: &'life2 str,
initial_state: CommandState,
deadline: Option<DateTime<Utc>>,
request_size_bytes: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<CommandMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new command and return metadata for routing. Read more
Source§fn get_command_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CommandEnvelopeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_command_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CommandEnvelopeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get metadata needed to build an envelope during lease acquisition. Read more
Source§fn get_command_status<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CommandStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_command_status<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CommandStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get full command status for status endpoint. Read more
Source§fn update_command_state<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
state: CommandState,
dispatched_at: Option<DateTime<Utc>>,
completed_at: Option<DateTime<Utc>>,
response_size_bytes: Option<u64>,
error: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_command_state<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
state: CommandState,
dispatched_at: Option<DateTime<Utc>>,
completed_at: Option<DateTime<Utc>>,
response_size_bytes: Option<u64>,
error: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update command state during lifecycle (dispatched, completed, failed).
Auto Trait Implementations§
impl Freeze for InMemoryCommandRegistry
impl !RefUnwindSafe for InMemoryCommandRegistry
impl Send for InMemoryCommandRegistry
impl Sync for InMemoryCommandRegistry
impl Unpin for InMemoryCommandRegistry
impl UnsafeUnpin for InMemoryCommandRegistry
impl !UnwindSafe for InMemoryCommandRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.