Enum substrate::geometry::prelude::NamedOrientation
source · #[non_exhaustive]pub enum NamedOrientation {
R0,
ReflectVert,
ReflectHoriz,
R90,
R180,
R270,
R90Cw,
R180Cw,
R270Cw,
FlipYx,
FlipMinusYx,
}
Expand description
A named orientation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
R0
No rotations or reflections.
ReflectVert
Reflect vertically (ie. about the x-axis).
ReflectHoriz
Reflect horizontally (ie. about the y-axis).
R90
Rotate 90 degrees counter-clockwise.
R180
Rotate 180 degrees counter-clockwise.
R270
Rotate 270 degrees counter-clockwise.
R90Cw
Rotate 90 degrees clockwise.
R180Cw
Rotate 180 degrees clockwise.
R270Cw
Rotate 270 degrees clockwise.
FlipYx
Flip across the line y = x.
FlipMinusYx
Flip across the line y = -x.
Implementations§
source§impl NamedOrientation
impl NamedOrientation
sourcepub fn all_rectangular() -> [NamedOrientation; 8]
pub fn all_rectangular() -> [NamedOrientation; 8]
Returns a slice of all 8 possible named rectangular orientations.
Users should not rely upon the order of the orientations returned.
sourcepub fn into_orientation(self) -> Orientation
pub fn into_orientation(self) -> Orientation
Converts this named orientation into a regular Orientation
.
sourcepub fn from_orientation(orientation: Orientation) -> Option<NamedOrientation>
pub fn from_orientation(orientation: Orientation) -> Option<NamedOrientation>
Attempts to convert the given orientation to a named orientation.
The conversion is based on approximate equality.
If no named orientation is approximately equal to orientation
,
returns None
.
Trait Implementations§
source§impl Clone for NamedOrientation
impl Clone for NamedOrientation
source§fn clone(&self) -> NamedOrientation
fn clone(&self) -> NamedOrientation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NamedOrientation
impl Debug for NamedOrientation
source§impl Default for NamedOrientation
impl Default for NamedOrientation
source§fn default() -> NamedOrientation
fn default() -> NamedOrientation
source§impl<'de> Deserialize<'de> for NamedOrientation
impl<'de> Deserialize<'de> for NamedOrientation
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<NamedOrientation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<NamedOrientation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<NamedOrientation> for Orientation
impl From<NamedOrientation> for Orientation
source§fn from(value: NamedOrientation) -> Orientation
fn from(value: NamedOrientation) -> Orientation
source§impl Hash for NamedOrientation
impl Hash for NamedOrientation
source§impl PartialEq for NamedOrientation
impl PartialEq for NamedOrientation
source§fn eq(&self, other: &NamedOrientation) -> bool
fn eq(&self, other: &NamedOrientation) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for NamedOrientation
impl Serialize for NamedOrientation
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,
impl Copy for NamedOrientation
impl Eq for NamedOrientation
impl StructuralPartialEq for NamedOrientation
Auto Trait Implementations§
impl RefUnwindSafe for NamedOrientation
impl Send for NamedOrientation
impl Sync for NamedOrientation
impl Unpin for NamedOrientation
impl UnwindSafe for NamedOrientation
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
source§impl<T, U> CustomHardwareType<Flipped<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Flipped<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Flipped<T>) -> U
fn from_layout_type(other: &Flipped<T>) -> U
source§impl<T, U> CustomHardwareType<InOut<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<InOut<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &InOut<T>) -> U
fn from_layout_type(other: &InOut<T>) -> U
source§impl<T, U> CustomHardwareType<Input<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Input<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Input<T>) -> U
fn from_layout_type(other: &Input<T>) -> U
source§impl<T, U> CustomHardwareType<Output<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Output<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Output<T>) -> U
fn from_layout_type(other: &Output<T>) -> U
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request