#[repr(u8)]pub enum AlignmentSafety {
Default = 0,
Unsafe = 1,
Safe = 2,
}Expand description
The overflow-position modifier per CSS Box Alignment §4.3.
Safe falls back to start-edge alignment when the alignment subject would
overflow the alignment container, so the start of the content stays visible.
Unsafe keeps the requested alignment even when that causes overflow at the
start edge. Default (no overflow-position keyword specified) behaves as
Unsafe, except for absolutely positioned boxes whose alignment is instead
adjusted to minimize overflow per CSS Box Alignment §4.4.1.2.
CSS only defines safe / unsafe against the position values start, end,
flex-start, flex-end, center. The struct shape does not enforce that
constraint at the type level — the parser rejects invalid combinations, and
the compute pass treats Safe paired with a non-position keyword (Stretch,
Baseline, Space*) the same as Unsafe.
Variants§
Default = 0
No overflow-position keyword specified. Behaves as Unsafe, except for absolutely
positioned boxes, whose alignment is adjusted to minimize overflow of their
containing block.
Unsafe = 1
Keeps the requested alignment even when the subject overflows the alignment container at the start edge.
Safe = 2
Falls back to the start edge when the subject would overflow, to avoid data loss.
Trait Implementations§
Source§impl Clone for AlignmentSafety
impl Clone for AlignmentSafety
Source§fn clone(&self) -> AlignmentSafety
fn clone(&self) -> AlignmentSafety
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more