Skip to main content

Neuron

Trait Neuron 

Source
pub trait Neuron<T, C>:
    Debug
    + Send
    + Sync
    + 'static
where C: Codec<T> + CodecName + Send + Sync + 'static, T: Send + Sync + 'static,
{ // Required methods fn encode(&self, data: &T) -> Result<Vec<u8>, NeuronError>; fn decode(&self, data: &[u8]) -> Result<T, NeuronError>; fn name(&self) -> String; fn name_without_codec(&self) -> String; fn schema(&self) -> String; fn clone_to_box(&self) -> Box<dyn Neuron<T, C> + Send + Sync + 'static>; fn clone_to_arc(&self) -> Arc<dyn Neuron<T, C> + Send + Sync + 'static>; }

Required Methods§

Source

fn encode(&self, data: &T) -> Result<Vec<u8>, NeuronError>

Source

fn decode(&self, data: &[u8]) -> Result<T, NeuronError>

Source

fn name(&self) -> String

Source

fn name_without_codec(&self) -> String

Source

fn schema(&self) -> String

Source

fn clone_to_box(&self) -> Box<dyn Neuron<T, C> + Send + Sync + 'static>

Source

fn clone_to_arc(&self) -> Arc<dyn Neuron<T, C> + Send + Sync + 'static>

Implementors§

Source§

impl<T, C> Neuron<T, C> for NeuronImpl<T, C>
where C: Codec<T> + CodecName + Send + Sync + 'static, T: Send + Sync + 'static, Self: Send + Sync + 'static,