Skip to main content

TraitSet

Struct TraitSet 

Source
pub struct TraitSet {
Show 38 fields pub color: Option<Color>, pub background_color: Option<Color>, pub font_family: Option<String>, pub font_size: Option<Length>, pub font_weight: Option<u16>, pub font_style: Option<FontStyle>, pub text_decoration: Option<TextDecoration>, pub border_width: Option<[Length; 4]>, pub border_color: Option<[Color; 4]>, pub border_style: Option<[BorderStyle; 4]>, pub padding: Option<[Length; 4]>, pub text_align: Option<TextAlign>, pub link_destination: Option<String>, pub is_leader: Option<String>, pub rule_thickness: Option<Length>, pub rule_style: Option<String>, pub line_height: Option<Length>, pub letter_spacing: Option<Length>, pub word_spacing: Option<Length>, pub border_radius: Option<[Length; 4]>, pub overflow: Option<OverflowBehavior>, pub opacity: Option<f64>, pub text_transform: Option<TextTransform>, pub font_variant: Option<FontVariant>, pub display_align: Option<DisplayAlign>, pub baseline_shift: Option<f64>, pub hyphenate: Option<bool>, pub hyphenation_min_word_chars: Option<u32>, pub hyphenation_push_chars: Option<u32>, pub hyphenation_remain_chars: Option<u32>, pub font_stretch: Option<FontStretch>, pub text_align_last: Option<TextAlign>, pub change_bar_color: Option<Color>, pub span: Span, pub role: Option<String>, pub xml_lang: Option<String>, pub writing_mode: WritingMode, pub direction: Direction,
}
Expand description

Rendering traits for an area

These are the properties that affect rendering (color, background, borders, etc.)

Fields§

§color: Option<Color>

Text color

§background_color: Option<Color>

Background color

§font_family: Option<String>

Font family

§font_size: Option<Length>

Font size

§font_weight: Option<u16>

Font weight (100-900, 400 = normal, 700 = bold)

§font_style: Option<FontStyle>

Font style (normal, italic, oblique)

§text_decoration: Option<TextDecoration>

Text decoration

§border_width: Option<[Length; 4]>

Border widths (top, right, bottom, left)

§border_color: Option<[Color; 4]>

Border colors (top, right, bottom, left)

§border_style: Option<[BorderStyle; 4]>

Border styles (top, right, bottom, left)

§padding: Option<[Length; 4]>

Padding (top, right, bottom, left)

§text_align: Option<TextAlign>

Text alignment

§link_destination: Option<String>

Link destination (for hyperlinks)

§is_leader: Option<String>

Leader pattern (dots, rule, space, use-content)

§rule_thickness: Option<Length>

Rule thickness (for rule leaders)

§rule_style: Option<String>

Rule style (for rule leaders: solid, dashed, dotted)

§line_height: Option<Length>

Line height

§letter_spacing: Option<Length>

Letter spacing (extra space between characters)

§word_spacing: Option<Length>

Word spacing (extra space between words)

§border_radius: Option<[Length; 4]>

Border radius for rounded corners (top-left, top-right, bottom-right, bottom-left) Each corner can have independent radius values

§overflow: Option<OverflowBehavior>

Overflow behavior - controls clipping of content

§opacity: Option<f64>

Opacity - transparency level (0.0 = transparent, 1.0 = opaque)

§text_transform: Option<TextTransform>

Text transformation

§font_variant: Option<FontVariant>

Font variant

§display_align: Option<DisplayAlign>

Display alignment (vertical alignment)

§baseline_shift: Option<f64>

Baseline shift for inline positioning (positive = up, negative = down, as fraction of font-size)

§hyphenate: Option<bool>

Whether hyphenation is enabled

§hyphenation_min_word_chars: Option<u32>

Minimum word length before hyphenation (hyphenation-minimum-word-count)

§hyphenation_push_chars: Option<u32>

Characters before hyphen (hyphenation-push-character-count)

§hyphenation_remain_chars: Option<u32>

Characters after hyphen (hyphenation-remain-character-count)

§font_stretch: Option<FontStretch>

Font stretch (condensed/expanded)

§text_align_last: Option<TextAlign>

Text alignment for last line (used with justify)

§change_bar_color: Option<Color>

Change bar color (for margin rule rendering)

§span: Span

Span property (none or all columns)

§role: Option<String>

Role attribute for accessibility tagging (PDF/UA)

§xml_lang: Option<String>

Language attribute (xml:lang) for language tagging

§writing_mode: WritingMode

Writing mode (lr-tb, rl-tb, tb-rl, tb-lr)

§direction: Direction

Text direction (ltr, rtl)

Trait Implementations§

Source§

impl Clone for TraitSet

Source§

fn clone(&self) -> TraitSet

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TraitSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TraitSet

Source§

fn default() -> TraitSet

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.