[][src]Struct deoxy::Motor

pub struct Motor { /* fields omitted */ }

A motor connected to the syringe manifold.

Moving a motor (physically) will cause the control knob to rotate.

Methods

impl Motor[src]

pub fn set_angle(&mut self, angle: u16) -> Result<(), PinError>[src]

Sets the motor's angle in degrees (relative to the closed position).

Panics

This method will panic if angle is greater than 180.

pub fn close(&mut self) -> Result<(), PinError>[src]

Sets the motor to the closed position (angle of 90º).

Fluid will flow through the valve, but not from the associated buffer.

pub fn shut(&mut self) -> Result<(), PinError>[src]

Sets the motor to the shut position, where no fluid will flow through it.

pub fn open(&mut self) -> Result<(), PinError>[src]

Sets the motor to the open position (angle of 0º).

Fluid from the associated buffer will flow through the valve.

pub fn try_new<R>(
    period: Duration,
    range: R,
    pin: u16
) -> Result<Self, PinError> where
    R: Into<RangeInclusive<Duration>>, 
[src]

Constructs a new motor with the given period and signal range on the given pin number, if possible.

The motor will be set to the closed position initially.

pub fn new<R>(period: Duration, range: R, pin: u16) -> Self where
    R: Into<RangeInclusive<Duration>>, 
[src]

Constructs a new motor with the given period and signal range on the given pin number.

The motor will be set to the closed position initially.

Panics

This method will panic if opening the pin fails. For a fallible initializer, see Motor::try_new.

Trait Implementations

impl Eq for Motor[src]

impl PartialEq<Motor> for Motor[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Debug for Motor[src]

impl Actor for Motor[src]

type Context = Context<Self>

Actor execution context type

fn started(&mut self, ctx: &mut Self::Context)

Method is called when actor get polled first time.

fn stopping(&mut self, ctx: &mut Self::Context) -> Running

Method is called after an actor is in Actor::Stopping state. There could be several reasons for stopping. Context::stop get called by the actor itself. All addresses to current actor get dropped and no more evented objects left in the context. Read more

fn stopped(&mut self, ctx: &mut Self::Context)

Method is called after an actor is stopped, it can be used to perform any needed cleanup work or spawning more actors. This is final state, after this call actor get dropped. Read more

fn start(self) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>, 

Start new asynchronous actor, returns address of newly created actor. Read more

fn start_default() -> Addr<Self> where
    Self: Actor<Context = Context<Self>> + Default

Start new asynchronous actor, returns address of newly created actor.

fn create<F>(f: F) -> Addr<Self> where
    F: FnOnce(&mut Context<Self>) -> Self + 'static,
    Self: Actor<Context = Context<Self>>, 

Use create method, if you need Context object during actor initialization. Read more

impl Handler<Message> for Motor[src]

type Result = ()

The type of value that this handle will return

Auto Trait Implementations

impl Send for Motor

impl !Sync for Motor

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self