Trait gigtag::label::Label

source ·
pub trait Label: AsRef<str> + Debug + Default + PartialEq + Ord + Sized {
    // Required methods
    fn from_cow_str(label: Cow<'_, str>) -> Self;
    fn from_format_args(format_args: Arguments<'_>) -> Self;

    // Provided methods
    fn from_str(label: &str) -> Self { ... }
    fn from_string(label: String) -> Self { ... }
    fn is_valid(&self) -> bool { ... }
    fn is_empty(&self) -> bool { ... }
}
Expand description

Common trait for labels

Required Methods§

source

fn from_cow_str(label: Cow<'_, str>) -> Self

Create a label from a copy-on-write string.

The argument must be a valid label.

source

fn from_format_args(format_args: Arguments<'_>) -> Self

Create a label from a precompiled format string.

Provided Methods§

source

fn from_str(label: &str) -> Self

Create a label from a borrowed string slice.

The argument must be a valid label.

source

fn from_string(label: String) -> Self

Create a label from a owned string.

The argument must be a valid label.

source

fn is_valid(&self) -> bool

source

fn is_empty(&self) -> bool

Object Safety§

This trait is not object safe.

Implementors§