Struct Metadata

Source
pub struct Metadata<'a> {
    pub style: Style,
    pub label: &'a str,
    pub message: &'a str,
    pub font: FontArc,
    pub font_family: FontFamily,
    pub label_color: Option<&'a str>,
    pub color: Option<&'a str>,
}
Expand description

Metadata represents all information required to build a badge.

Fields§

§style: Style

The desired badge style

§label: &'a str

The text to be shown on the badge’s label (left side)

§message: &'a str

The message to be shown on the badge’s message (right side)

§font: FontArc

A FontArc to be used for measuring the final size of a badge.

§font_family: FontFamily

The FontFamily to be used when rendering this badge.

§label_color: Option<&'a str>

The color for the badge’s label background. When None, a default grayish tone is used. When provided, any CSS color may be used.

§color: Option<&'a str>

The color for the badge’s message background. When None, a default greenish color is used. When provided, any CSS color may be used.

Auto Trait Implementations§

§

impl<'a> Freeze for Metadata<'a>

§

impl<'a> !RefUnwindSafe for Metadata<'a>

§

impl<'a> Send for Metadata<'a>

§

impl<'a> Sync for Metadata<'a>

§

impl<'a> Unpin for Metadata<'a>

§

impl<'a> !UnwindSafe for Metadata<'a>

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> 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, 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.