Skip to main content

FontModifiable

Trait FontModifiable 

Source
pub trait FontModifiable {
    type R: AsRef<str>;

    // Required methods
    fn apply<'a>(self, mods: ModifierSeq) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_blackboard<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_fraktur<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_script<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_bold<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_smallcaps<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_monospaced<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_italic<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_oblique<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;
    fn make_sans<'a>(self) -> CharConverter<'a, Self::R>
       where Self: 'a;

    // Provided method
    fn apply_modifiers<'a>(
        self,
        mods: &'a [FontModifier],
    ) -> CharConverter<'a, Self::R>
       where Self: 'a + Sized { ... }
}
Expand description

A trait for applying font modifiers to something. Implemented for anything that implements AsRef<str>, and for CharConverter for chaining.

Required Associated Types§

Source

type R: AsRef<str>

The base type of this object; usually Self

Required Methods§

Source

fn apply<'a>(self, mods: ModifierSeq) -> CharConverter<'a, Self::R>
where Self: 'a,

Apply the given modifiers to this object.

Source

fn make_blackboard<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Blackboard modifier.

Source

fn make_fraktur<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Fraktur modifier.

Source

fn make_script<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Script modifier.

Source

fn make_bold<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Bold modifier.

Source

fn make_smallcaps<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Capitals modifier.

Source

fn make_monospaced<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Monospaced modifier.

Source

fn make_italic<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Italic modifier.

Source

fn make_oblique<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the Oblique modifier.

Source

fn make_sans<'a>(self) -> CharConverter<'a, Self::R>
where Self: 'a,

Applies the SansSerif modifier.

Provided Methods§

Source

fn apply_modifiers<'a>( self, mods: &'a [FontModifier], ) -> CharConverter<'a, Self::R>
where Self: 'a + Sized,

Add the given modifiers to this object.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S: AsRef<str>> FontModifiable for &S

Source§

type R = S

Source§

fn apply<'b>(self, mods: ModifierSeq) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_blackboard<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_fraktur<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_script<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_bold<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_smallcaps<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_monospaced<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_italic<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_oblique<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Source§

fn make_sans<'b>(self) -> CharConverter<'b, S>
where Self: 'b,

Implementors§