[][src]Struct librobot::transmission::servo::Servo

pub struct Servo {
    pub id: u8,
    pub known_position: u16,
    pub control: Control,
    pub rotation: Rotation,
    pub data: u16,
    pub blocked: bool,
    pub mode: BlockingMode,
    pub color: Color,
}

Représentation d'un unique servo-moteur

Fields

id: u8

Identifiant du servo-moteur.

known_position: u16

Position actuelle du servo-moteur.

control: Control

Commande du servo soit en angle soit en vitesse.

rotation: Rotation

Sens de rotation associé à une commande en vitesse. TODO : on doit remplir de champ pour une commande en position aussi, mais je ne sais pas comment faire rentrer ce champ dans le control : en faisant une enum plus intelligente :

pub enum Control {
    Speed {
        rotation: Rotation,
    },
    Position,
}

la lib serde_json_core n'est pas capable de désérialiser (elle attend des types primitifs mais on lui donne une structure complexe à manger, aka Control) -- @Terae

data: u16

Représente les informations de contrôle associées à la commande Speed ou Position.

blocked: bool

Retourne vrai si le servo-moteur est bloqué

mode: BlockingMode

Comportement du servo-moteur face à un blocage extérieur.

color: Color

Couleur émise par le servo-moteur.

Trait Implementations

impl Jsonizable for Servo[src]

fn from_json_slice(slice: &[u8]) -> Result<Self, DError>[src]

Désérialisation d'un JSON en Servo

fn to_string<B>(&self) -> Result<String<B>, SError> where
    B: ArrayLength<u8>, 
[src]

Sérialisation d'un Servo en JSON

impl PartialEq<Servo> for Servo[src]

Relation d'équivalence partielle pour le module Servo2019, utile pour le débug.

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

This method tests for !=.

impl Eq for Servo[src]

impl Debug for Servo[src]

impl Copy for Servo[src]

impl Clone for Servo[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Servo[src]

impl Serialize for Servo[src]

impl<'de> Deserialize<'de> for Servo[src]

Auto Trait Implementations

impl Send for Servo

impl Sync for Servo

Blanket Implementations

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]