pub enum Alignment {
Start,
End,
Left,
Right,
Center,
Justify,
}Expand description
Text alignment within a line.
Left/Right are absolute; Start/End are relative to the
paragraph’s base direction and are what an unset alignment should
use. Keeping both lets a writer who explicitly chose “flush left” keep
that in an RTL paragraph, while a paragraph nobody has aligned simply
follows its own direction.
Variants§
Start
Leading edge: left in an LTR paragraph, right in an RTL one.
End
Trailing edge: right in an LTR paragraph, left in an RTL one.
Left
Right
Center
Justify
Implementations§
Source§impl Alignment
impl Alignment
Sourcepub fn resolve_for(self, base: TextDirection) -> Alignment
pub fn resolve_for(self, base: TextDirection) -> Alignment
Resolve the direction-relative variants against a base direction.
Always returns an absolute alignment, so line layout never has to think about direction again.
Trait Implementations§
impl Copy for Alignment
impl Eq for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
impl Freeze for Alignment
impl RefUnwindSafe for Alignment
impl Send for Alignment
impl Sync for Alignment
impl Unpin for Alignment
impl UnsafeUnpin for Alignment
impl UnwindSafe for Alignment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.