pub struct NeuronErasedWrapper<T, C> { /* private fields */ }Expand description
Wrapper that implements NeuronErased for any concrete Neuron
Implementations§
Source§impl<T, C> NeuronErasedWrapper<T, C>
impl<T, C> NeuronErasedWrapper<T, C>
Source§impl<T, C> NeuronErasedWrapper<T, C>
impl<T, C> NeuronErasedWrapper<T, C>
Sourcepub fn to_typed_neuron<U, D>(
&self,
) -> ErasureResult<Arc<dyn Neuron<U, D> + Send + Sync + 'static>>
pub fn to_typed_neuron<U, D>( &self, ) -> ErasureResult<Arc<dyn Neuron<U, D> + Send + Sync + 'static>>
Convert this wrapper to a correctly typed neuron with different type parameters Returns an error if the type parameters don’t match
Trait Implementations§
Source§impl<T, C> NeuronErased for NeuronErasedWrapper<T, C>
impl<T, C> NeuronErased for NeuronErasedWrapper<T, C>
fn name(&self) -> String
fn name_without_codec(&self) -> String
fn schema(&self) -> String
fn payload_type_id(&self) -> TypeId
fn codec_type_id(&self) -> TypeId
fn clone_to_box(&self) -> Box<dyn NeuronErased + Send + Sync + 'static>
fn clone_to_arc(&self) -> Arc<dyn NeuronErased + Send + Sync + 'static>
fn encode_any(&self, data: &dyn Any) -> Result<Vec<u8>, NeuronError>
fn decode_any(&self, data: &[u8]) -> Result<Box<dyn Any>, NeuronError>
fn as_any(&self) -> &dyn Any
Auto Trait Implementations§
impl<T, C> Freeze for NeuronErasedWrapper<T, C>
impl<T, C> !RefUnwindSafe for NeuronErasedWrapper<T, C>
impl<T, C> Send for NeuronErasedWrapper<T, C>
impl<T, C> Sync for NeuronErasedWrapper<T, C>
impl<T, C> Unpin for NeuronErasedWrapper<T, C>
impl<T, C> !UnwindSafe for NeuronErasedWrapper<T, C>
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