pub struct CompositeHandlerAdapter { /* private fields */ }Expand description
Adapter to make CompositeHandler work as RegistrableHandler
Implementations§
Source§impl CompositeHandlerAdapter
impl CompositeHandlerAdapter
Sourcepub fn new(composite: CompositeHandler) -> Self
pub fn new(composite: CompositeHandler) -> Self
Create a new adapter
Sourcepub fn for_testing(device_id: DeviceId) -> Self
pub fn for_testing(device_id: DeviceId) -> Self
Create adapter for testing
Sourcepub fn for_production(device_id: DeviceId) -> Self
pub fn for_production(device_id: DeviceId) -> Self
Create adapter for production
Sourcepub fn for_simulation(device_id: DeviceId, seed: u64) -> Self
pub fn for_simulation(device_id: DeviceId, seed: u64) -> Self
Create adapter 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
Sourcepub fn into_composite(self) -> CompositeHandler
pub fn into_composite(self) -> CompositeHandler
Get the underlying composite handler
Sourcepub fn composite(&self) -> &CompositeHandler
pub fn composite(&self) -> &CompositeHandler
Get a reference to the composite handler
Sourcepub fn composite_mut(&mut self) -> &mut CompositeHandler
pub fn composite_mut(&mut self) -> &mut CompositeHandler
Get a mutable reference to the composite handler
Trait Implementations§
Source§impl Handler for CompositeHandlerAdapter
impl Handler for CompositeHandlerAdapter
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
Source§impl RegistrableHandler for CompositeHandlerAdapter
impl RegistrableHandler for CompositeHandlerAdapter
Source§fn execute_operation_bytes<'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_operation_bytes<'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 a specific operation within an effect type Read more
Source§fn supported_operations(&self, effect_type: EffectType) -> Vec<String>
fn supported_operations(&self, effect_type: EffectType) -> Vec<String>
Get the list of operations supported by this handler for a given effect type Read more
Source§fn supports_effect(&self, effect_type: EffectType) -> bool
fn supports_effect(&self, effect_type: EffectType) -> bool
Check if this handler supports the given effect type
Source§fn execution_mode(&self) -> ExecutionMode
fn execution_mode(&self) -> ExecutionMode
Get the execution mode of this handler
Source§fn supports_operation(&self, effect_type: EffectType, operation: &str) -> bool
fn supports_operation(&self, effect_type: EffectType, operation: &str) -> bool
Check if a specific operation is supported
Auto Trait Implementations§
impl Freeze for CompositeHandlerAdapter
impl !RefUnwindSafe for CompositeHandlerAdapter
impl Send for CompositeHandlerAdapter
impl Sync for CompositeHandlerAdapter
impl Unpin for CompositeHandlerAdapter
impl UnsafeUnpin for CompositeHandlerAdapter
impl !UnwindSafe for CompositeHandlerAdapter
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.