pub enum LinearDirection {
Forward = 1,
Backward = -1,
Stay = 0,
}
Expand description
The LinearDirection
implementation enumerates the three pssoible movements in
one-dimensional space, namely:
Variants§
Implementations§
Source§impl LinearDirection
impl LinearDirection
Sourcepub const fn is_forward(&self) -> bool
pub const fn is_forward(&self) -> bool
Returns true if the enum is LinearDirection::Forward otherwise false
Sourcepub const fn is_backward(&self) -> bool
pub const fn is_backward(&self) -> bool
Returns true if the enum is LinearDirection::Backward otherwise false
Source§impl LinearDirection
impl LinearDirection
pub fn from_isize(value: isize) -> LinearDirection
Sourcepub const fn backward() -> LinearDirection
pub const fn backward() -> LinearDirection
a functional method for initializing a new backward variant
Sourcepub const fn stay() -> LinearDirection
pub const fn stay() -> LinearDirection
a functional method for initializing a new stay variant
Sourcepub const fn forward() -> LinearDirection
pub const fn forward() -> LinearDirection
a functional method for initializing a new forward variant
Trait Implementations§
Source§impl AsRef<str> for LinearDirection
impl AsRef<str> for LinearDirection
Source§impl Clone for LinearDirection
impl Clone for LinearDirection
Source§fn clone(&self) -> LinearDirection
fn clone(&self) -> LinearDirection
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LinearDirection
impl Debug for LinearDirection
Source§impl Default for LinearDirection
impl Default for LinearDirection
Source§fn default() -> LinearDirection
fn default() -> LinearDirection
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LinearDirection
impl<'de> Deserialize<'de> for LinearDirection
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LinearDirection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LinearDirection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LinearDirection
impl Display for LinearDirection
Source§impl FromStr for LinearDirection
impl FromStr for LinearDirection
Source§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
Source§fn from_str(
s: &str,
) -> Result<LinearDirection, <LinearDirection as FromStr>::Err>
fn from_str( s: &str, ) -> Result<LinearDirection, <LinearDirection as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreSource§impl Hash for LinearDirection
impl Hash for LinearDirection
Source§impl IntoEnumIterator for LinearDirection
impl IntoEnumIterator for LinearDirection
type Iterator = LinearDirectionIter
fn iter() -> LinearDirectionIter ⓘ
Source§impl Ord for LinearDirection
impl Ord for LinearDirection
Source§fn cmp(&self, other: &LinearDirection) -> Ordering
fn cmp(&self, other: &LinearDirection) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LinearDirection
impl PartialEq for LinearDirection
Source§impl PartialOrd for LinearDirection
impl PartialOrd for LinearDirection
Source§impl Serialize for LinearDirection
impl Serialize for LinearDirection
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&str> for LinearDirection
impl TryFrom<&str> for LinearDirection
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
Source§fn try_from(
s: &str,
) -> Result<LinearDirection, <LinearDirection as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<LinearDirection, <LinearDirection as TryFrom<&str>>::Error>
Performs the conversion.
Source§impl VariantNames for LinearDirection
impl VariantNames for LinearDirection
impl Copy for LinearDirection
impl Eq for LinearDirection
impl StructuralPartialEq for LinearDirection
Auto Trait Implementations§
impl Freeze for LinearDirection
impl RefUnwindSafe for LinearDirection
impl Send for LinearDirection
impl Sync for LinearDirection
impl Unpin for LinearDirection
impl UnwindSafe for LinearDirection
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