Skip to main content

ReactantErased

Trait ReactantErased 

Source
pub trait ReactantErased:
    Send
    + Sync
    + 'static {
    // Required methods
    fn react_erased(
        &self,
        payload: Arc<dyn PayloadErased + Send + Sync + 'static>,
    ) -> Pin<Box<dyn Future<Output = Result<(), ReactantError>> + Send + 'static>>;
    fn payload_type_id(&self) -> TypeId;
    fn codec_type_id(&self) -> TypeId;
    fn clone_to_box(&self) -> Box<dyn ReactantErased + Send + Sync + 'static>;
    fn clone_to_arc(&self) -> Arc<dyn ReactantErased + Send + Sync + 'static>;
    fn clone_to_any(&self) -> Arc<dyn Any + Send + Sync + 'static>;
    fn as_any(&self) -> &dyn Any;
}
Expand description

Type-erased reactant that can be stored in collections with other type-erased reactants

Required Methods§

Source

fn react_erased( &self, payload: Arc<dyn PayloadErased + Send + Sync + 'static>, ) -> Pin<Box<dyn Future<Output = Result<(), ReactantError>> + Send + 'static>>

Source

fn payload_type_id(&self) -> TypeId

Source

fn codec_type_id(&self) -> TypeId

Source

fn clone_to_box(&self) -> Box<dyn ReactantErased + Send + Sync + 'static>

Source

fn clone_to_arc(&self) -> Arc<dyn ReactantErased + Send + Sync + 'static>

Source

fn clone_to_any(&self) -> Arc<dyn Any + Send + Sync + 'static>

Source

fn as_any(&self) -> &dyn Any

Implementors§

Source§

impl<T, C, R> ReactantErased for ReactantErasedWrapper<T, C, R>
where T: Send + Sync + 'static, C: Codec<T> + CodecName + Send + Sync + 'static, R: Reactant<T, C> + Send + Sync + Clone + 'static,