pub enum Flip {
None,
Horizontal,
Vertical,
Both,
}
Expand description
Represents the four states an object can be in, if it can be flipped horizontally and vertically.
Variants§
None
Nothing is flipped at all
+---------+
|A B|
| |
|C D|
+---------+
Horizontal
Flipped on the horizontal axis
+---------+
|C D|
>- -|- - - - -|- -<
|A B|
+---------+
Vertical
Flipped on the vertical axis
v
|
+---------+
|B | A|
| | |
|D | C|
+---------+
|
^
Both
Flipped on horizontal and vertical axis
v
|
+---------+
|D | C|
>- -|- - + - -|- -<
|B | A|
+---------+
|
^
Implementations§
Source§impl Flip
impl Flip
Sourcepub fn is_flipped_horizontal(&self) -> bool
pub fn is_flipped_horizontal(&self) -> bool
Indicates whether the variant is flipped horizontally, independent of vertical
Sourcepub fn is_flipped_vertical(&self) -> bool
pub fn is_flipped_vertical(&self) -> bool
Indicates whether the variant is flipped vertically, independent of horizontal
Sourcepub fn toggle_horizontal(&self) -> Flip
pub fn toggle_horizontal(&self) -> Flip
Returns the resulting Flip
state when flipped horizontally
Sourcepub fn toggle_vertical(&self) -> Flip
pub fn toggle_vertical(&self) -> Flip
Returns the resulting Flip
state when flipped vertically
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Flip
impl<'de> Deserialize<'de> for Flip
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
impl Copy for Flip
impl Eq for Flip
impl StructuralPartialEq for Flip
Auto Trait Implementations§
impl Freeze for Flip
impl RefUnwindSafe for Flip
impl Send for Flip
impl Sync for Flip
impl Unpin for Flip
impl UnwindSafe for Flip
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