Identity

Struct Identity 

Source
pub struct Identity<T> { /* private fields */ }
Expand description

Forwards messages as is

Trait Implementations§

Source§

impl<T> Codelet for Identity<T>
where T: Clone + Send + Sync,

Source§

type Status = DefaultStatus

Status code used to indicate health of codelet
Source§

type Config = ()

Type used for configuration
Source§

type Rx = DoubleBufferRx<T>

Type holding all receiving (RX) endpoints
Source§

type Tx = DoubleBufferTx<T>

Type holding all transmitting (TX) endpoints
Source§

type Signals = ()

Type storing the codelet’s signals
Source§

fn build_bundles(_config: &Self::Config) -> (Self::Rx, Self::Tx)

Constructs channel bundles
Source§

fn start( &mut self, _cx: Context<'_, Self>, rx: &mut Self::Rx, tx: &mut Self::Tx, ) -> Outcome

Start is guaranteed to be called first. Start may be called again after stop was called.
Source§

fn step( &mut self, _cx: Context<'_, Self>, rx: &mut Self::Rx, tx: &mut Self::Tx, ) -> Outcome

Step is executed periodically after the codelet is started and while it is not paused.
Source§

fn stop( &mut self, _cx: Context<'_, Self>, _rx: &mut Self::Rx, _tx: &mut Self::Tx, ) -> Result<Self::Status, Report>

Stop is guaranteed to be called at the end if start was called.
Source§

fn pause(&mut self) -> Result<Self::Status, Report>

Pause may be called to suspend stepping.
Source§

fn resume(&mut self) -> Result<Self::Status, Report>

Resume is called to resume stepping. Note that stop may also be called while the codelet is paused to stop the codelet completely instead of resuming stepping.
Source§

impl<T> Default for Identity<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Identity<T>

§

impl<T> RefUnwindSafe for Identity<T>
where T: RefUnwindSafe,

§

impl<T> Send for Identity<T>
where T: Send,

§

impl<T> Sync for Identity<T>
where T: Sync,

§

impl<T> Unpin for Identity<T>
where T: Unpin,

§

impl<T> UnwindSafe for Identity<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<C> Instantiate for C
where C: Codelet + Default,

Source§

fn instantiate<S>(name: S, config: <C as Codelet>::Config) -> CodeletInstance<C>
where S: Into<String>,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<C> IntoInstance for C
where C: Codelet,

Source§

fn into_instance<S>( self, name: S, config: <C as Codelet>::Config, ) -> CodeletInstance<C>
where S: Into<String>,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.