CuRuntime

Struct CuRuntime 

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>{
    pub clock: RobotClock,
    pub tasks: CT,
    pub threadpool: Arc<ThreadPool>,
    pub monitor: M,
    pub copperlists_manager: CopperListsManager<P, NBCL>,
    pub keyframes_manager: KeyFramesManager,
    pub runtime_config: RuntimeConfig,
}
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§

§clock: RobotClock

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

§tasks: CT

The tuple of all the tasks in order of execution.

§threadpool: Arc<ThreadPool>

For backgrounded tasks.

§monitor: M

The runtime monitoring.

§copperlists_manager: CopperListsManager<P, NBCL>

The logger for the copper lists (messages between tasks)

§keyframes_manager: KeyFramesManager

The logger for the state of the tasks (frozen tasks)

§runtime_config: RuntimeConfig

The runtime configuration controlling the behavior of the run loop

Implementations§

Source§

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

Source

pub fn new( clock: RobotClock, config: &CuConfig, mission: Option<&str>, tasks_instanciator: impl for<'c> Fn(Vec<Option<&'c ComponentConfig>>, Arc<ThreadPool>) -> Result<CT, CuError>, monitor_instanciator: impl Fn(&CuConfig) -> M, copperlists_logger: impl WriteStream<CopperList<P>> + 'static, keyframes_logger: impl WriteStream<KeyFrame> + 'static, ) -> Result<CuRuntime<CT, P, M, NBCL>, CuError>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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,