pub struct LogicalEdges {
pub top: f32,
pub bottom: f32,
pub start: f32,
pub end: f32,
}Expand description
Direction-aware logical edge insets in density-independent units (dp).
Shared across components to avoid duplicating per-component padding structs.
Fields§
§top: f32Top edge inset in logical units.
bottom: f32Bottom edge inset in logical units.
start: f32Inline-start edge inset (left in LTR, right in RTL).
end: f32Inline-end edge inset (right in LTR, left in RTL).
Implementations§
Source§impl LogicalEdges
impl LogicalEdges
Sourcepub const fn all(value: f32) -> Self
pub const fn all(value: f32) -> Self
Creates uniform insets on all four sides, clamping invalid or negative values to 0.0.
Sourcepub const fn symmetric(horizontal: f32, vertical: f32) -> Self
pub const fn symmetric(horizontal: f32, vertical: f32) -> Self
Creates symmetric insets from horizontal (start/end) and vertical (top/bottom).
Sourcepub const fn new(top: f32, end: f32, bottom: f32, start: f32) -> Self
pub const fn new(top: f32, end: f32, bottom: f32, start: f32) -> Self
Creates explicit logical insets in CSS-like (top, end, bottom, start) order.
Sourcepub const fn horizontal(self, value: f32) -> Self
pub const fn horizontal(self, value: f32) -> Self
Sets both start and end insets.
Sourcepub const fn sanitize(self) -> Self
pub const fn sanitize(self) -> Self
Returns a copy with every side sanitized via non_negative_f32.
Trait Implementations§
Source§impl Clone for LogicalEdges
impl Clone for LogicalEdges
impl Copy for LogicalEdges
Source§impl Debug for LogicalEdges
impl Debug for LogicalEdges
Source§impl Default for LogicalEdges
impl Default for LogicalEdges
Source§impl<'de> Deserialize<'de> for LogicalEdges
impl<'de> Deserialize<'de> for LogicalEdges
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LogicalEdges
impl PartialEq for LogicalEdges
Source§impl Serialize for LogicalEdges
impl Serialize for LogicalEdges
impl StructuralPartialEq for LogicalEdges
Auto Trait Implementations§
impl Forget for LogicalEdges
impl Freeze for LogicalEdges
impl Move for LogicalEdges
impl RefUnwindSafe for LogicalEdges
impl Send for LogicalEdges
impl Sync for LogicalEdges
impl Unpin for LogicalEdges
impl UnsafeUnpin for LogicalEdges
impl UnwindSafe for LogicalEdges
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