cu29::curuntime

Struct CuRuntime

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>{
    pub tasks: CT,
    pub monitor: M,
    pub copper_lists_manager: CuListsManager<P, NBCL>,
    pub clock: RobotClock,
    /* private fields */
}
Expand description

This is the main structure that will be injected as a member of the Application struct. CT is the tuple of all the tasks in order of execution. CL is the type of the copper list, representing the input/output messages for all the tasks.

Fields§

§tasks: CT

The tuple of all the tasks in order of execution.

§monitor: M§copper_lists_manager: CuListsManager<P, NBCL>

Copper lists hold in order all the input/output messages for all the tasks.

§clock: RobotClock

The base clock the runtime will be using to record time.

Implementations§

Source§

impl<CT, P, M, const NBCL: usize> CuRuntime<CT, P, M, NBCL>
where P: CopperListTuple + 'static, M: CuMonitor,

Source

pub fn new( clock: RobotClock, config: &CuConfig, tasks_instanciator: impl Fn(Vec<Option<&ComponentConfig>>) -> Result<CT, CuError>, monitor_instanciator: impl Fn(&CuConfig) -> M, logger: impl WriteStream<CopperList<P>> + 'static, ) -> Result<CuRuntime<CT, P, M, NBCL>, CuError>

Source

pub fn available_copper_lists(&self) -> usize

Source

pub fn end_of_processing(&mut self, culistid: u32)

Trait Implementations§

Source§

impl<CT, P, M, const NBCL: usize> ClockProvider for CuRuntime<CT, P, M, NBCL>

To be able to share the clock we make the runtime a clock provider.

Auto Trait Implementations§

§

impl<CT, P, M, const NBCL: usize> Freeze for CuRuntime<CT, P, M, NBCL>
where CT: Freeze, M: Freeze,

§

impl<CT, P, M, const NBCL: usize> !RefUnwindSafe for CuRuntime<CT, P, M, NBCL>

§

impl<CT, P, M, const NBCL: usize> Send for CuRuntime<CT, P, M, NBCL>
where CT: Send, M: Send, P: Send,

§

impl<CT, P, M, const NBCL: usize> Sync for CuRuntime<CT, P, M, NBCL>
where CT: Sync, M: Sync, P: Sync,

§

impl<CT, P, M, const NBCL: usize> Unpin for CuRuntime<CT, P, M, NBCL>
where CT: Unpin, M: Unpin,

§

impl<CT, P, M, const NBCL: usize> !UnwindSafe for CuRuntime<CT, P, M, NBCL>

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

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T