Competition

Struct Competition 

Source
pub struct Competition<R: Robot>(/* private fields */);
Expand description

Competition state machine.

Implementations§

Source§

impl<R: Robot> Competition<R>

Source

pub fn new(robot: R) -> Self

Constructs a new instance of the state machine.

Source

pub fn initialize(&self) -> Promise

Runs on initialization.

Source

pub fn initialize_ext(&self, ctx: Context) -> Promise

Runs on initialization.

Source

pub fn autonomous(&self) -> Promise

Runs during the autonomous period.

Source

pub fn autonomous_ext(&self, ctx: Context) -> Promise

Runs during the autonomous period.

Source

pub fn opcontrol(&self) -> Promise

Runs during the opcontrol period.

Source

pub fn opcontrol_ext(&self, ctx: Context) -> Promise

Runs during the opcontrol period.

Source

pub fn disabled(&self) -> Promise

Runs when the robot is disabled.

Source

pub fn disabled_ext(&self, ctx: Context) -> Promise

Runs when the robot is disabled.

Trait Implementations§

Source§

impl<R: Robot> StateMachine for Competition<R>

Source§

type State = CompetitionState

The state type used by the state machine.
Source§

fn state(&self) -> Self::State

Gets the current state of the state machine.
Source§

fn transition(&self, state: Self::State) -> Context

Transitions the state machine to a new state. Read more

Auto Trait Implementations§

§

impl<R> Freeze for Competition<R>

§

impl<R> !RefUnwindSafe for Competition<R>

§

impl<R> Send for Competition<R>

§

impl<R> Sync for Competition<R>

§

impl<R> Unpin for Competition<R>
where R: Unpin,

§

impl<R> !UnwindSafe for Competition<R>

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.