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 ZERO: LogicalEdges
pub const ZERO: LogicalEdges
Zero insets on all four sides.
Sourcepub const fn all(value: f32) -> LogicalEdges
pub const fn all(value: f32) -> LogicalEdges
Creates uniform insets on all four sides, clamping invalid or negative values to 0.0.
Sourcepub const fn symmetric(horizontal: f32, vertical: f32) -> LogicalEdges
pub const fn symmetric(horizontal: f32, vertical: f32) -> LogicalEdges
Creates symmetric insets from horizontal (start/end) and vertical (top/bottom).
Sourcepub const fn new(top: f32, end: f32, bottom: f32, start: f32) -> LogicalEdges
pub const fn new(top: f32, end: f32, bottom: f32, start: f32) -> LogicalEdges
Creates explicit logical insets in CSS-like (top, end, bottom, start) order.
Sourcepub const fn top(self, value: f32) -> LogicalEdges
pub const fn top(self, value: f32) -> LogicalEdges
Sets the top inset.
Sourcepub const fn bottom(self, value: f32) -> LogicalEdges
pub const fn bottom(self, value: f32) -> LogicalEdges
Sets the bottom inset.
Sourcepub const fn start(self, value: f32) -> LogicalEdges
pub const fn start(self, value: f32) -> LogicalEdges
Sets the inline-start inset.
Sourcepub const fn end(self, value: f32) -> LogicalEdges
pub const fn end(self, value: f32) -> LogicalEdges
Sets the inline-end inset.
Sourcepub const fn horizontal(self, value: f32) -> LogicalEdges
pub const fn horizontal(self, value: f32) -> LogicalEdges
Sets both start and end insets.
Sourcepub const fn vertical(self, value: f32) -> LogicalEdges
pub const fn vertical(self, value: f32) -> LogicalEdges
Sets both top and bottom insets.
Sourcepub const fn sanitize(self) -> LogicalEdges
pub const fn sanitize(self) -> LogicalEdges
Returns a copy with every side sanitized via non_negative_f32.
Trait Implementations§
Source§impl Clone for LogicalEdges
impl Clone for LogicalEdges
Source§fn clone(&self) -> LogicalEdges
fn clone(&self) -> LogicalEdges
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LogicalEdges
Source§impl Debug for LogicalEdges
impl Debug for LogicalEdges
Source§impl Default for LogicalEdges
impl Default for LogicalEdges
Source§fn default() -> LogicalEdges
fn default() -> LogicalEdges
Source§impl PartialEq for LogicalEdges
impl PartialEq 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
ReadEndian::read_from_little_endian().