pub struct Insets {
pub top: f64,
pub leading: f64,
pub bottom: f64,
pub trailing: f64,
}Expand description
Logical insets: leading/trailing resolve against the layout direction at place time (§7.8).
Fields§
§top: f64§leading: f64§bottom: f64§trailing: f64Implementations§
Source§impl Insets
impl Insets
pub const ZERO: Insets
Sourcepub const fn new(top: f64, leading: f64, bottom: f64, trailing: f64) -> Self
pub const fn new(top: f64, leading: f64, bottom: f64, trailing: f64) -> Self
Four explicit edges, in the order they are named.
pub const fn all(d: f64) -> Self
pub const fn symmetric(horizontal: f64, vertical: f64) -> Self
Sourcepub const fn horizontal(d: f64) -> Self
pub const fn horizontal(d: f64) -> Self
d on the leading and trailing edges, nothing above or below.
Sourcepub fn horizontal_total(&self) -> f64
pub fn horizontal_total(&self) -> f64
The width the insets take: leading plus trailing.
Sourcepub fn vertical_total(&self) -> f64
pub fn vertical_total(&self) -> f64
The height the insets take: top plus bottom.
Trait Implementations§
impl Copy for Insets
impl StructuralPartialEq for Insets
Auto Trait Implementations§
impl Freeze for Insets
impl RefUnwindSafe for Insets
impl Send for Insets
impl Sync for Insets
impl Unpin for Insets
impl UnsafeUnpin for Insets
impl UnwindSafe for Insets
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