pub struct SynapseExternalErasedWrapper<T, C, S> { /* private fields */ }Expand description
Wrapper that implements SynapseExternalErased for any concrete SynapseExternal
Implementations§
Source§impl<T, C, S> SynapseExternalErasedWrapper<T, C, S>
impl<T, C, S> SynapseExternalErasedWrapper<T, C, S>
pub fn new(synapse: S) -> Self
Sourcepub fn from_typed_synapse(
synapse: S,
) -> Arc<RwLock<dyn SynapseExternalErased + Send + Sync + 'static>>where
T: 'static,
C: 'static,
S: 'static,
pub fn from_typed_synapse(
synapse: S,
) -> Arc<RwLock<dyn SynapseExternalErased + Send + Sync + 'static>>where
T: 'static,
C: 'static,
S: 'static,
Create a type-erased external synapse from a correctly typed external synapse
Sourcepub fn to_typed_synapse<U, D, R>(&self) -> ErasureResult<Arc<RwLock<R>>>
pub fn to_typed_synapse<U, D, R>(&self) -> ErasureResult<Arc<RwLock<R>>>
Safely attempt to downcast an erased external synapse to its concrete type.
Trait Implementations§
Source§impl<T, C, S> SynapseExternalErased for SynapseExternalErasedWrapper<T, C, S>
impl<T, C, S> SynapseExternalErased for SynapseExternalErasedWrapper<T, C, S>
fn as_any(&self) -> &dyn Any
fn neuron(&self) -> Arc<dyn NeuronErased + Send + Sync + 'static>
fn transduce_erased( &self, payload: Arc<dyn PayloadRawErased + Send + Sync + 'static>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<()>, Vec<()>), SynapseError>> + Send + 'static>>
fn transmit_erased( &self, payload: Arc<dyn PayloadRawErased + Send + Sync + 'static>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<()>, Vec<()>), SynapseError>> + Send + 'static>>
fn react_erased( &mut self, reactants: Vec<Arc<dyn ReactantErased + Send + Sync + 'static>>, raw_reactants: Vec<Arc<dyn ReactantRawErased + Send + Sync + 'static>>, error_reactants: Vec<Arc<dyn ErrorReactantErased + Send + Sync>>, )
fn neuron_name(&self) -> String
fn codec_name(&self) -> String
fn neuron_schema(&self) -> String
fn payload_type_id(&self) -> TypeId
fn codec_type_id(&self) -> TypeId
fn clone_to_box(&self) -> Box<dyn SynapseExternalErased + Send + Sync + 'static>
fn clone_to_arc( &self, ) -> Arc<RwLock<dyn SynapseExternalErased + Send + Sync + 'static>>
Auto Trait Implementations§
impl<T, C, S> Freeze for SynapseExternalErasedWrapper<T, C, S>
impl<T, C, S> RefUnwindSafe for SynapseExternalErasedWrapper<T, C, S>where
T: RefUnwindSafe,
C: RefUnwindSafe,
impl<T, C, S> Send for SynapseExternalErasedWrapper<T, C, S>
impl<T, C, S> Sync for SynapseExternalErasedWrapper<T, C, S>
impl<T, C, S> Unpin for SynapseExternalErasedWrapper<T, C, S>
impl<T, C, S> UnwindSafe for SynapseExternalErasedWrapper<T, C, S>where
T: UnwindSafe,
C: UnwindSafe,
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 more