[][src]Struct badge_maker::BadgeBuilder

pub struct BadgeBuilder { /* fields omitted */ }

Constructs a Badge with given options. Message is the only required field.

Each field has a variant that is the field() for constructing with absolute rust safety. Those fields also have alternate field_parse() methods for 3rd party use that wants to rely on the library for parsing and validation of the fields.

Example

example: badgeexamplebadge

use badge_maker::BadgeBuilder;

let badge = BadgeBuilder::new()
  .label("example")
  .message("badge")
  .color_parse("success")
  .build()?;

println!("{}", badge.svg());

Implementations

impl BadgeBuilder[src]

pub fn new() -> Self[src]

pub fn label(&mut self, label: &str) -> &mut Self[src]

pub fn message(&mut self, message: &str) -> &mut Self[src]

pub fn label_color_parse(&mut self, label_color: &str) -> &mut Self[src]

pub fn label_color(&mut self, color: Color) -> &mut Self[src]

pub fn color_parse(&mut self, color: &str) -> &mut Self[src]

pub fn color(&mut self, color: Color) -> &mut Self[src]

pub fn style_parse(&mut self, style: &str) -> &mut Self[src]

pub fn style(&mut self, style: Style) -> &mut Self[src]

pub fn logo_url(&mut self, url: &str) -> &mut Self[src]

pub fn logo_width(&mut self, width: usize) -> &mut Self[src]

pub fn logo_padding(&mut self, padding: isize) -> &mut Self[src]

pub fn build(&self) -> Result<Badge, Error>[src]

Trait Implementations

impl Default for BadgeBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.