[−][src]Struct librobot::transmission::servo::Servo
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]
B: ArrayLength<u8>,
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.
fn eq(&self, other: &Servo) -> bool
[src]
#[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(&self) -> 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]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Servo
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,