Enum libreda_db::prelude::Orientation2D
source · [−]pub enum Orientation2D {
Horizontal,
Vertical,
}
Expand description
Orientation in two dimensions along one of the axes.
Variants
Horizontal
Oriented parallel to the x axis.
Vertical
Oriented parallel to the y axis.
Implementations
sourceimpl Orientation2D
impl Orientation2D
sourcepub fn other(self) -> Orientation2D
pub fn other(self) -> Orientation2D
Get the orthogonal orientation.
sourcepub fn direction(self, d1: Direction1D) -> Direction2D
pub fn direction(self, d1: Direction1D) -> Direction2D
Get the positive or negative direction aligned with this orientation.
sourcepub fn is_vertical(&self) -> bool
pub fn is_vertical(&self) -> bool
Check if orientation is vertical.
sourcepub fn is_horizontal(&self) -> bool
pub fn is_horizontal(&self) -> bool
Check if orientation is horizontal.
Trait Implementations
sourceimpl Clone for Orientation2D
impl Clone for Orientation2D
sourcefn clone(&self) -> Orientation2D
fn clone(&self) -> Orientation2D
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Orientation2D
impl Debug for Orientation2D
sourceimpl<'de> Deserialize<'de> for Orientation2D
impl<'de> Deserialize<'de> for Orientation2D
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Orientation2D, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Orientation2D, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Hash for Orientation2D
impl Hash for Orientation2D
sourceimpl Ord for Orientation2D
impl Ord for Orientation2D
sourcefn cmp(&self, other: &Orientation2D) -> Ordering
fn cmp(&self, other: &Orientation2D) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Orientation2D> for Orientation2D
impl PartialEq<Orientation2D> for Orientation2D
sourceimpl PartialOrd<Orientation2D> for Orientation2D
impl PartialOrd<Orientation2D> for Orientation2D
sourcefn partial_cmp(&self, other: &Orientation2D) -> Option<Ordering>
fn partial_cmp(&self, other: &Orientation2D) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for Orientation2D
impl Serialize for Orientation2D
sourcefn 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
impl Copy for Orientation2D
impl Eq for Orientation2D
impl StructuralEq for Orientation2D
impl StructuralPartialEq for Orientation2D
Auto Trait Implementations
impl RefUnwindSafe for Orientation2D
impl Send for Orientation2D
impl Sync for Orientation2D
impl Unpin for Orientation2D
impl UnwindSafe for Orientation2D
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more