#[non_exhaustive]pub struct TextIndent {
pub amount: LengthDefaultsToZero,
pub each_line: bool,
pub hanging: bool,
}Expand description
Controls indentation of the first line, or hanging/each-line variants.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.amount: LengthDefaultsToZeroThe indent amount.
each_line: boolApply the indent after every hard line break.
hanging: boolIndent continuation lines instead of the first line.
Implementations§
Source§impl TextIndent
impl TextIndent
Sourcepub const fn new(amount: LengthDefaultsToZero) -> Self
pub const fn new(amount: LengthDefaultsToZero) -> Self
Creates a text indent with the given amount and default keyword options.
Sourcepub const fn with_each_line(self, each_line: bool) -> Self
pub const fn with_each_line(self, each_line: bool) -> Self
Sets whether the indent also applies after explicit line breaks.
Sourcepub const fn with_hanging(self, hanging: bool) -> Self
pub const fn with_hanging(self, hanging: bool) -> Self
Sets whether continuation lines are indented instead of the first line.
pub fn resolve_px(self, sizing: &SizingContext, line_width: f32) -> f32
Trait Implementations§
Source§impl Clone for TextIndent
impl Clone for TextIndent
Source§fn clone(&self) -> TextIndent
fn clone(&self) -> TextIndent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextIndent
Source§impl Debug for TextIndent
impl Debug for TextIndent
Source§impl Default for TextIndent
impl Default for TextIndent
Source§fn default() -> TextIndent
fn default() -> TextIndent
Returns the “default value” for a type. Read more
Source§impl<'i> FromCss<'i> for TextIndent
impl<'i> FromCss<'i> for TextIndent
Source§const VALID_TOKENS: &'static [CssToken]
const VALID_TOKENS: &'static [CssToken]
Returns the list of valid CSS tokens for this type.
Source§fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
Parses the type from a
Parser instance.Source§fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
Helper function to parse the type from a string.
Source§const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
Message template used when building parse errors for this type.
Source§impl PartialEq for TextIndent
impl PartialEq for TextIndent
Source§fn eq(&self, other: &TextIndent) -> bool
fn eq(&self, other: &TextIndent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TextIndent
Auto Trait Implementations§
impl Freeze for TextIndent
impl RefUnwindSafe for TextIndent
impl Send for TextIndent
impl Sync for TextIndent
impl Unpin for TextIndent
impl UnsafeUnpin for TextIndent
impl UnwindSafe for TextIndent
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