pub enum HorizontalAlignment {
Left,
Center,
Right,
}Expand description
Horizontal content alignment within a layout area.
Prior to Ratatui 0.30.0, this type was named Alignment. In Ratatui 0.30.0, the name was
changed to HorizontalAlignment to make it more descriptive. The old name is still available as
an alias for backwards compatibility.
This type is used throughout Ratatui to control how content is positioned horizontally within available space. It’s commonly used with widgets to control text alignment, but can also be used in layout calculations.
For comprehensive layout documentation and examples, see the layout module.
Variants§
Trait Implementations§
Source§impl Clone for HorizontalAlignment
impl Clone for HorizontalAlignment
Source§fn clone(&self) -> HorizontalAlignment
fn clone(&self) -> HorizontalAlignment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HorizontalAlignment
impl Debug for HorizontalAlignment
Source§impl Default for HorizontalAlignment
impl Default for HorizontalAlignment
Source§fn default() -> HorizontalAlignment
fn default() -> HorizontalAlignment
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HorizontalAlignment
impl<'de> Deserialize<'de> for HorizontalAlignment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HorizontalAlignment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HorizontalAlignment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for HorizontalAlignment
impl Display for HorizontalAlignment
Source§impl FromStr for HorizontalAlignment
impl FromStr for HorizontalAlignment
Source§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
Source§fn from_str(
s: &str,
) -> Result<HorizontalAlignment, <HorizontalAlignment as FromStr>::Err>
fn from_str( s: &str, ) -> Result<HorizontalAlignment, <HorizontalAlignment as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for HorizontalAlignment
impl Hash for HorizontalAlignment
Source§impl PartialEq for HorizontalAlignment
impl PartialEq for HorizontalAlignment
Source§impl Serialize for HorizontalAlignment
impl Serialize for HorizontalAlignment
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&str> for HorizontalAlignment
impl TryFrom<&str> for HorizontalAlignment
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
Source§fn try_from(
s: &str,
) -> Result<HorizontalAlignment, <HorizontalAlignment as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<HorizontalAlignment, <HorizontalAlignment as TryFrom<&str>>::Error>
Performs the conversion.
impl Copy for HorizontalAlignment
impl Eq for HorizontalAlignment
impl StructuralPartialEq for HorizontalAlignment
Auto Trait Implementations§
impl Freeze for HorizontalAlignment
impl RefUnwindSafe for HorizontalAlignment
impl Send for HorizontalAlignment
impl Sync for HorizontalAlignment
impl Unpin for HorizontalAlignment
impl UnsafeUnpin for HorizontalAlignment
impl UnwindSafe for HorizontalAlignment
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read moreSource§impl<T> TransformExt for T
impl<T> TransformExt for T
fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q
fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T
Source§fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
Example Read more