pub struct HAnchor(/* private fields */);Expand description
Horizontal anchor flags — how a widget sizes and positions itself horizontally within the slot assigned by its parent.
| Constant | Meaning |
|---|---|
ABSOLUTE | No automatic sizing or positioning (manual bounds). |
LEFT | Align to the left edge of the slot (respecting margin). |
CENTER | Center horizontally in the slot (respecting margin). |
RIGHT | Align to the right edge of the slot (respecting margin). |
FIT | Width encloses natural content (default). |
STRETCH | Fill the slot width (LEFT | RIGHT). |
MAX_FIT_OR_STRETCH | Take the larger of Fit or Stretch. |
MIN_FIT_OR_STRETCH | Take the smaller of Fit or Stretch. |
At most one of LEFT, CENTER, RIGHT may be set for position anchoring;
combining LEFT | RIGHT means “stretch”, not “anchor to both edges”.
Implementations§
Source§impl HAnchor
impl HAnchor
pub const ABSOLUTE: Self
pub const LEFT: Self
pub const CENTER: Self
pub const RIGHT: Self
Sourcepub const MAX_FIT_OR_STRETCH: Self
pub const MAX_FIT_OR_STRETCH: Self
Take the larger of Fit or Stretch.
Sourcepub const MIN_FIT_OR_STRETCH: Self
pub const MIN_FIT_OR_STRETCH: Self
Take the smaller of Fit or Stretch.
Sourcepub fn is_stretch(self) -> bool
pub fn is_stretch(self) -> bool
Returns true if this anchor causes horizontal stretching
(both LEFT and RIGHT are set, or MIN/MAX_FIT_OR_STRETCH resolves to stretch).
Trait Implementations§
impl Copy for HAnchor
impl Eq for HAnchor
impl StructuralPartialEq for HAnchor
Auto Trait Implementations§
impl Freeze for HAnchor
impl RefUnwindSafe for HAnchor
impl Send for HAnchor
impl Sync for HAnchor
impl Unpin for HAnchor
impl UnsafeUnpin for HAnchor
impl UnwindSafe for HAnchor
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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().