pub struct Anchor {
pub top: bool,
pub bottom: bool,
pub left: bool,
pub right: bool,
}Expand description
Anchor edges for layer surface positioning.
When opposite edges are anchored (e.g., left + right), the surface stretches to fill that axis. When only one edge is anchored, the surface is placed at that edge with its requested size.
Fields§
§top: bool§bottom: bool§left: bool§right: boolImplementations§
Source§impl Anchor
impl Anchor
Sourcepub fn from_bits(bits: u32) -> Self
pub fn from_bits(bits: u32) -> Self
Create an Anchor from a bitfield (protocol wire format).
Bit 0 = top, bit 1 = bottom, bit 2 = left, bit 3 = right.
Sourcepub fn stretches_horizontal(&self) -> bool
pub fn stretches_horizontal(&self) -> bool
Whether this anchor stretches horizontally (left + right).
Sourcepub fn stretches_vertical(&self) -> bool
pub fn stretches_vertical(&self) -> bool
Whether this anchor stretches vertically (top + bottom).
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 UnwindSafe for Anchor
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)