[−][src]Struct badge_maker::BadgeBuilder
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
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 link(&mut self, link: &str) -> &mut Self
[src]
pub fn logo(&mut self, logo: Logo) -> &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 link_left(&mut self, link: &str) -> &mut Self
[src]
pub fn link_right(&mut self, link: &str) -> &mut Self
[src]
pub fn build(&self) -> Result<Badge, Error>
[src]
Trait Implementations
impl Default for BadgeBuilder
[src]
pub fn default() -> BadgeBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for BadgeBuilder
[src]
impl Send for BadgeBuilder
[src]
impl Sync for BadgeBuilder
[src]
impl Unpin for BadgeBuilder
[src]
impl UnwindSafe for BadgeBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,