pub struct CompositeHandler { /* private fields */ }Expand description
A composite handler that delegates to specialized handlers based on effect type
Implementations§
Source§impl CompositeHandler
impl CompositeHandler
Sourcepub fn new(device_id: DeviceId, execution_mode: ExecutionMode) -> Self
pub fn new(device_id: DeviceId, execution_mode: ExecutionMode) -> Self
Create a new composite handler
Sourcepub fn for_testing(device_id: DeviceId) -> Self
pub fn for_testing(device_id: DeviceId) -> Self
Create a composite handler for testing
Sourcepub fn for_production(device_id: DeviceId) -> Self
pub fn for_production(device_id: DeviceId) -> Self
Create a composite handler for production
Sourcepub fn for_simulation(device_id: DeviceId, seed: u64) -> Self
pub fn for_simulation(device_id: DeviceId, seed: u64) -> Self
Create a composite handler for simulation
Sourcepub fn register_handler(
&mut self,
effect_type: EffectType,
handler: Box<dyn Handler>,
) -> Result<(), CompositeError>
pub fn register_handler( &mut self, effect_type: EffectType, handler: Box<dyn Handler>, ) -> Result<(), CompositeError>
Register a handler for a specific effect type
Sourcepub fn register_all(
&mut self,
options: RegisterAllOptions,
) -> Result<(), RegistryError>
pub fn register_all( &mut self, options: RegisterAllOptions, ) -> Result<(), RegistryError>
Register the default handler bundle.
Requires explicit opt-in for impure handlers via RegisterAllOptions.
Sourcepub fn unregister_handler(
&mut self,
effect_type: EffectType,
) -> Option<Box<dyn RegistrableHandler>>
pub fn unregister_handler( &mut self, effect_type: EffectType, ) -> Option<Box<dyn RegistrableHandler>>
Unregister a handler for a specific effect type
Sourcepub fn has_handler(&self, effect_type: EffectType) -> bool
pub fn has_handler(&self, effect_type: EffectType) -> bool
Check if a handler is registered for an effect type
Sourcepub fn registered_effect_types(&self) -> Vec<EffectType>
pub fn registered_effect_types(&self) -> Vec<EffectType>
Get all registered effect types
Trait Implementations§
Source§impl Handler for CompositeHandler
impl Handler for CompositeHandler
Source§fn execute_effect<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
effect_type: EffectType,
operation: &'life1 str,
parameters: &'life2 [u8],
ctx: &'life3 HandlerContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, HandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute_effect<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
effect_type: EffectType,
operation: &'life1 str,
parameters: &'life2 [u8],
ctx: &'life3 HandlerContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, HandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute an effect with serialized parameters and return serialized result
Source§fn execute_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: LocalSessionType,
ctx: &'life1 HandlerContext,
) -> Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: LocalSessionType,
ctx: &'life1 HandlerContext,
) -> Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute a session type
Source§fn supports_effect(&self, effect_type: EffectType) -> bool
fn supports_effect(&self, effect_type: EffectType) -> bool
Check if this handler supports a specific effect type
Source§fn execution_mode(&self) -> ExecutionMode
fn execution_mode(&self) -> ExecutionMode
Get the execution mode of this handler
Source§fn supported_effects(&self) -> Vec<EffectType>
fn supported_effects(&self) -> Vec<EffectType>
Get supported effect types
Auto Trait Implementations§
impl Freeze for CompositeHandler
impl !RefUnwindSafe for CompositeHandler
impl Send for CompositeHandler
impl Sync for CompositeHandler
impl Unpin for CompositeHandler
impl UnsafeUnpin for CompositeHandler
impl !UnwindSafe for CompositeHandler
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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> IntoViewDelta for T
impl<T> IntoViewDelta for T
Source§fn into_view_delta(self) -> ViewDelta
fn into_view_delta(self) -> ViewDelta
Convert self into a type-erased ViewDelta.
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.