Skip to main content

NeuronErased

Trait NeuronErased 

Source
pub trait NeuronErased:
    Send
    + Sync
    + 'static {
    // Required methods
    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;
}
Expand description

Type-erased neuron that can be stored in collections with other type-erased neurons

Required Methods§

Source

fn name(&self) -> String

Source

fn name_without_codec(&self) -> String

Source

fn schema(&self) -> String

Source

fn payload_type_id(&self) -> TypeId

Source

fn codec_type_id(&self) -> TypeId

Source

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

Source

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

Source

fn encode_any(&self, data: &dyn Any) -> Result<Vec<u8>, NeuronError>

Source

fn decode_any(&self, data: &[u8]) -> Result<Box<dyn Any>, NeuronError>

Source

fn as_any(&self) -> &dyn Any

Implementors§

Source§

impl<T, C> NeuronErased for NeuronErasedWrapper<T, C>
where T: Send + Sync + 'static, C: Codec<T> + CodecName + Send + Sync + 'static,