pub struct EdgeInsets {
pub left: f32,
pub top: f32,
pub right: f32,
pub bottom: f32,
}Expand description
Padding or margin insets on all four sides (logical pixels).
§Examples
use ailloli_ui_core::EdgeInsets;
assert_eq!(EdgeInsets::all(4.0).horizontal(), 8.0);Fields§
§left: f32Left inset in logical pixels.
top: f32Top inset in logical pixels.
right: f32Right inset in logical pixels.
bottom: f32Bottom inset in logical pixels.
Implementations§
Source§impl EdgeInsets
impl EdgeInsets
Sourcepub const fn new(left: f32, top: f32, right: f32, bottom: f32) -> Self
pub const fn new(left: f32, top: f32, right: f32, bottom: f32) -> Self
Creates per-side insets without clamping negative or non-finite values.
§Examples
use ailloli_ui_core::EdgeInsets;
assert_eq!(EdgeInsets::new(1.0, 2.0, 3.0, 4.0).right, 3.0);Sourcepub const fn all(v: f32) -> Self
pub const fn all(v: f32) -> Self
Creates equal insets on all four sides.
§Examples
use ailloli_ui_core::EdgeInsets;
assert_eq!(EdgeInsets::all(3.0).bottom, 3.0);Sourcepub const fn horizontal(&self) -> f32
pub const fn horizontal(&self) -> f32
left + right.
§Examples
use ailloli_ui_core::EdgeInsets;
assert_eq!(EdgeInsets::new(1.0, 2.0, 3.0, 4.0).horizontal(), 4.0);Trait Implementations§
Source§impl Clone for EdgeInsets
impl Clone for EdgeInsets
Source§fn clone(&self) -> EdgeInsets
fn clone(&self) -> EdgeInsets
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EdgeInsets
impl Debug for EdgeInsets
Source§impl Default for EdgeInsets
impl Default for EdgeInsets
Source§fn default() -> EdgeInsets
fn default() -> EdgeInsets
Returns the “default value” for a type. Read more
Source§impl PartialEq for EdgeInsets
impl PartialEq for EdgeInsets
impl Copy for EdgeInsets
impl StructuralPartialEq for EdgeInsets
Auto Trait Implementations§
impl Freeze for EdgeInsets
impl RefUnwindSafe for EdgeInsets
impl Send for EdgeInsets
impl Sync for EdgeInsets
impl Unpin for EdgeInsets
impl UnwindSafe for EdgeInsets
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