pub enum OpMode {
Unknown,
Manual,
SemiAutomatic,
Automatic,
Others,
Offline,
}
Expand description
Operating modes of the controller.
See this document for details.
Variants§
Unknown
Unknown operation mode.
Manual
Manual mode.
SemiAutomatic
Semi-Automatic mode.
Automatic
Automatic mode.
Others
Other unspecified operation mode.
Offline
The controller is off-line.
When the controller is off-line, both its operating mode and job mode should be Offline
.
Implementations§
Source§impl OpMode
impl OpMode
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if Unknown
.
§Examples
assert!(OpMode::Unknown.is_unknown());
assert!(!OpMode::Manual.is_unknown());
Sourcepub fn is_offline(&self) -> bool
pub fn is_offline(&self) -> bool
Returns true if Offline
.
§Examples
assert!(OpMode::Offline.is_offline());
assert!(!OpMode::Manual.is_offline());
Sourcepub fn is_online(&self) -> bool
pub fn is_online(&self) -> bool
Returns true for all variants other than Unknown
and Offline
.
§Examples
assert!(!OpMode::Offline.is_online());
assert!(!OpMode::Unknown.is_online());
assert!(OpMode::Automatic.is_online());
assert!(OpMode::Manual.is_online());
Sourcepub fn is_producing(&self) -> bool
pub fn is_producing(&self) -> bool
A machine is producing if it is in either Automatic
or Semi-Automatic
mode.
§Examples
assert!(!OpMode::Offline.is_producing());
assert!(!OpMode::Unknown.is_producing());
assert!(OpMode::Automatic.is_producing());
assert!(!OpMode::Manual.is_producing());
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OpMode
impl<'de> Deserialize<'de> for OpMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for OpMode
impl Ord for OpMode
Source§impl PartialOrd for OpMode
impl PartialOrd for OpMode
impl Copy for OpMode
impl Eq for OpMode
impl StructuralPartialEq for OpMode
Auto Trait Implementations§
impl Freeze for OpMode
impl RefUnwindSafe for OpMode
impl Send for OpMode
impl Sync for OpMode
impl Unpin for OpMode
impl UnwindSafe for OpMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.