#[non_exhaustive]pub struct TextFit {
pub mode: TextFitMode,
pub target: TextFitTarget,
pub limit: Option<f32>,
}Expand description
Controls whether inline contents are scaled to fit their line box.
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.mode: TextFitModeSelects whether fitting grows, shrinks, or leaves text unchanged.
target: TextFitTargetSelects whether fitting uses one scale or per-line scales.
limit: Option<f32>Optional scale clamp as a multiplier, parsed from a CSS percentage.
Implementations§
Trait Implementations§
impl Copy for TextFit
Source§impl<'i> FromCss<'i> for TextFit
impl<'i> FromCss<'i> for TextFit
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.
impl StructuralPartialEq for TextFit
Auto Trait Implementations§
impl Freeze for TextFit
impl RefUnwindSafe for TextFit
impl Send for TextFit
impl Sync for TextFit
impl Unpin for TextFit
impl UnsafeUnpin for TextFit
impl UnwindSafe for TextFit
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