pub struct OperationRegistry { /* private fields */ }Expand description
Typed operation dispatcher with an explicit scope authorizer and schema compatibility window.
Implementations§
Source§impl OperationRegistry
impl OperationRegistry
Sourcepub fn new<A>(scope_authorizer: A) -> Selfwhere
A: ScopeAuthorizer + 'static,
pub fn new<A>(scope_authorizer: A) -> Selfwhere
A: ScopeAuthorizer + 'static,
Creates an empty registry. Requiring an authorizer prevents an accidental allow-all scope.
Sourcepub fn register<O, H>(
&mut self,
handler: H,
) -> Result<&mut Self, RegistrationError>where
O: DomainOperation,
H: OperationHandler<O> + 'static,
pub fn register<O, H>(
&mut self,
handler: H,
) -> Result<&mut Self, RegistrationError>where
O: DomainOperation,
H: OperationHandler<O> + 'static,
Registers a handler for only its current payload schema.
§Errors
Returns RegistrationError::Duplicate when the operation kind is already registered.
Sourcepub fn register_with_migration<O, H, M>(
&mut self,
minimum_schema: u16,
handler: H,
migrator: M,
) -> Result<&mut Self, RegistrationError>
pub fn register_with_migration<O, H, M>( &mut self, minimum_schema: u16, handler: H, migrator: M, ) -> Result<&mut Self, RegistrationError>
Registers a handler and direct migration adapter for a bounded historical schema window.
§Errors
Returns RegistrationError for duplicate kinds or an invalid compatibility window.
Trait Implementations§
Source§impl OperationExecutor for OperationRegistry
impl OperationExecutor for OperationRegistry
Authorizes a requested partial sync scope before any entity or journal data is read.
Authorizes an operation before authoritative state is disclosed or conflict-tested.
Source§fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
auth: &'life1 AuthContext,
operation: ExecutableOperation<'life2>,
current: Option<&'life3 CurrentEntity>,
) -> Pin<Box<dyn Future<Output = Result<AuthoritativeMutation, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
auth: &'life1 AuthContext,
operation: ExecutableOperation<'life2>,
current: Option<&'life3 CurrentEntity>,
) -> Pin<Box<dyn Future<Output = Result<AuthoritativeMutation, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Validates business rules and executes an authorized operation into a
store-independent mutation.
Auto Trait Implementations§
impl !RefUnwindSafe for OperationRegistry
impl !UnwindSafe for OperationRegistry
impl Freeze for OperationRegistry
impl Send for OperationRegistry
impl Sync for OperationRegistry
impl Unpin for OperationRegistry
impl UnsafeUnpin for OperationRegistry
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