Struct CodeletInstance

Source
pub struct CodeletInstance<C: Codelet> {
    pub id: Option<NodeId>,
    pub crumbs: Option<SharedNodeCrumbs>,
    pub name: String,
    pub state: C,
    pub config: C::Config,
    pub config_aux: <C::Config as Config>::Aux,
    pub rx: C::Rx,
    pub tx: C::Tx,
    /* private fields */
}
Expand description

Named instance of a codelet with configuration and channel bundels

Fields§

§id: Option<NodeId>§crumbs: Option<SharedNodeCrumbs>§name: String§state: C§config: C::Config§config_aux: <C::Config as Config>::Aux§rx: C::Rx§tx: C::Tx

Implementations§

Source§

impl<C: Codelet> CodeletInstance<C>

Source

pub fn type_name(&self) -> &str

Source

pub fn modify_state_with<F>(self, f: F) -> Self
where F: Fn(&mut C),

Source

pub fn start(&mut self) -> Result<C::Status>

Source

pub fn stop(&mut self) -> Result<C::Status>

Source

pub fn step(&mut self) -> Result<C::Status>

Source

pub fn pause(&mut self) -> Result<C::Status>

Source

pub fn resume(&mut self) -> Result<C::Status>

Trait Implementations§

Source§

impl<C: Codelet> Drop for CodeletInstance<C>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<C: Codelet> Lifecycle for CodeletInstance<C>

Source§

fn cycle(&mut self, transition: Transition) -> Result<DefaultStatus>

Applies a lifecycel change
Source§

impl<C: Codelet + 'static> Schedulable for CodeletInstance<C>

Source§

fn schedule(self, sched: &mut ScheduleBuilder)

Source§

impl<C: Codelet + 'static> Sequenceable for CodeletInstance<C>

Source§

fn append(self, seq: &mut Sequence)

Source§

fn into_sequence(self) -> Sequence
where Self: Sized,

Source§

impl<C: Codelet> ViseTrait for CodeletInstance<C>

Source§

fn id(&self) -> NodeId

Unique nodelet ID assigned by the runtime
Source§

fn name(&self) -> &str

Nodelet name assignd by the user
Source§

fn type_name(&self) -> &str

The type name of the codelet as given by Rust compiler
Source§

fn rx_names(&self) -> Vec<&str>

Source§

fn tx_names(&self) -> Vec<&str>

Source§

fn signal_names(&self) -> Vec<&str>

Source§

fn status(&self) -> Option<(String, DefaultStatus)>

👎Deprecated
Gets the status as a string and the corresponding simplified status
Source§

fn setup(&mut self, setup: NodeletSetup)

Called once at the beginning to setup the clock
Source§

fn get_parameters_with_properties( &self, ) -> ParameterWithPropertiesSet<(), &'static str>

Get all configuration parameters and their properties
Source§

fn configure( &mut self, key: &str, value: &ParameterValue, ) -> Result<(), ViseConfigureError>

Change a configuration parameter

Auto Trait Implementations§

§

impl<C> Freeze for CodeletInstance<C>
where C: Freeze, <C as Codelet>::Config: Freeze, <<C as Codelet>::Config as Config>::Aux: Freeze, <C as Codelet>::Rx: Freeze, <C as Codelet>::Tx: Freeze, <C as Codelet>::Signals: Freeze, <C as Codelet>::Status: Freeze,

§

impl<C> RefUnwindSafe for CodeletInstance<C>

§

impl<C> Send for CodeletInstance<C>

§

impl<C> Sync for CodeletInstance<C>
where C: Sync, <C as Codelet>::Config: Sync, <<C as Codelet>::Config as Config>::Aux: Sync, <C as Codelet>::Rx: Sync, <C as Codelet>::Tx: Sync, <C as Codelet>::Signals: Sync,

§

impl<C> Unpin for CodeletInstance<C>
where C: Unpin, <C as Codelet>::Config: Unpin, <<C as Codelet>::Config as Config>::Aux: Unpin, <C as Codelet>::Rx: Unpin, <C as Codelet>::Tx: Unpin, <C as Codelet>::Signals: Unpin, <C as Codelet>::Status: Unpin,

§

impl<C> UnwindSafe for CodeletInstance<C>

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<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<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.