Trait ActionEncoder
pub trait ActionEncoder<'a> {
type A: CodedAction;
type UA: UncodedAction<'a>;
type K: ?Sized;
type Err: Error;
// Required methods
fn encode(&'a self, action: Self::UA) -> Result<Self::A, Self::Err>;
fn encode_raw(
&self,
port_name: impl AsRef<Self::K>,
) -> Result<Self::A, Self::Err>;
fn decode(&'a self, coded_action: Self::A) -> Result<Self::UA, Self::Err>;
fn lookup(
&'a self,
port_name: impl AsRef<Self::K>,
) -> Result<Self::UA, Self::Err>;
}Expand description
Encoder and decoder between UncodedAction and CodedAction.
This trait implementors should have all information about this device’s topology (name, ports, port mode, neighbors). The interface may be enriched.
Required Associated Types§
Required Methods§
fn encode(&'a self, action: Self::UA) -> Result<Self::A, Self::Err>
fn encode_raw( &self, port_name: impl AsRef<Self::K>, ) -> Result<Self::A, Self::Err>
fn decode(&'a self, coded_action: Self::A) -> Result<Self::UA, Self::Err>
fn lookup( &'a self, port_name: impl AsRef<Self::K>, ) -> Result<Self::UA, Self::Err>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.