pub enum Anchor {
TopLeft,
TopRight,
BottomLeft,
BottomRight,
TopCenter,
BottomCenter,
LeftCenter,
RightCenter,
}Expand description
Identifies a reference point on a 2D box, used to anchor positioned elements.
Variants§
TopLeft
The top left corner
TopRight
The top right corner
BottomLeft
The bottom left corner
BottomRight
The bottom right corner
TopCenter
The top center position
BottomCenter
The bottom center position
LeftCenter
The left center position
RightCenter
The right center position
Implementations§
Source§impl Anchor
impl Anchor
Sourcepub fn opposite(self) -> Self
pub fn opposite(self) -> Self
Returns the directly opposite corner.
§Examples
assert_eq!(Anchor::TopLeft.opposite(), Anchor::BottomRight);Sourcepub fn other_side_along(self, axis: Axis) -> Self
pub fn other_side_along(self, axis: Axis) -> Self
Returns the corner across from this corner, moving along the specified axis.
§Examples
let result = Anchor::TopLeft.other_side_along(Axis::Horizontal);
assert_eq!(result, Anchor::TopRight);Trait Implementations§
impl Copy for Anchor
impl Eq for Anchor
impl StructuralPartialEq for Anchor
Auto Trait Implementations§
impl Freeze for Anchor
impl RefUnwindSafe for Anchor
impl Send for Anchor
impl Sync for Anchor
impl Unpin for Anchor
impl UnsafeUnpin for Anchor
impl UnwindSafe for Anchor
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§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more