Struct cu_wt901::WT901

source ·
pub struct WT901 { /* private fields */ }

Trait Implementations§

source§

impl CuSrcTask for WT901

§

type Output = PositionalReadings

source§

fn process( &mut self, _clock: &RobotClock, new_msg: &mut CuMsg<Self::Output>, ) -> CuResult<()>

Process is the most critical execution of the task. The goal will be to produce the output message as soon as possible. Use preprocess to prepare the task to make this method as short as possible.
source§

impl CuTaskLifecycle for WT901

source§

fn new(_config: Option<&NodeInstanceConfig>) -> CuResult<Self>
where Self: Sized,

source§

fn start(&mut self, _clock: &RobotClock) -> Result<(), CuError>

Start is called once for a long period of time. Here you need to initialize everything your task will need for the duration of its lifetime.
source§

fn preprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>

This is a method called by the runtime before “process”. This is a kind of best effort, as soon as possible call to give a chance for the task to do some work before to prepare to make “process” as short as possible.
source§

fn postprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>

This is a method called by the runtime after “process”. It is best effort a chance for the task to update some state after process is out of the way. It can be use for example to maintain statistics etc. that are not time critical for the robot.
source§

fn stop(&mut self, _clock: &RobotClock) -> Result<(), CuError>

Call at the end of the lifecycle of the task.
source§

impl Freezable for WT901

source§

fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

This method is called by the framework when it wants to save the task state. The default implementation is to encode nothing (stateless). If you have a state, you need to implement this method.
source§

fn thaw<D>(&mut self, decoder: &mut D) -> Result<(), DecodeError>
where D: Decoder,

This method is called by the framework when it wants to restore the task to a specific state. Here it is similar to Decode but the framework will give you a new instance of the task (the new method will be called)

Auto Trait Implementations§

§

impl Freeze for WT901

§

impl !RefUnwindSafe for WT901

§

impl !Send for WT901

§

impl !Sync for WT901

§

impl Unpin for WT901

§

impl !UnwindSafe for WT901

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

§

type Output = T

Should always be Self
source§

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

§

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

§

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.