pub enum Direction {
Ltr,
Rtl,
}Expand description
The writing direction the layout resolves logical edges against.
Layout is authored in logical terms — start/end rather than left/right — and resolved to physical edges
when a style is handed to the engine. One build therefore serves both directions: flipping Direction
re-resolves the tree in place instead of rebuilding it, which is why the intent is kept alongside the
resolved style rather than baked into it.
Variants§
Implementations§
Source§impl Direction
impl Direction
pub fn is_rtl(self) -> bool
Sourcepub fn for_locale(locale: &str) -> Direction
pub fn for_locale(locale: &str) -> Direction
The direction conventionally written with locale’s script, keyed by language subtag: Arabic, Hebrew,
Persian, Urdu and the other right-to-left languages, matched against the tag’s primary subtag so
ar-EG resolves like ar.
Trait Implementations§
impl Copy for Direction
impl Eq for Direction
impl StructuralPartialEq for Direction
Auto Trait Implementations§
impl Freeze for Direction
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnsafeUnpin for Direction
impl UnwindSafe for Direction
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