Trait gigtag::props::Name

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

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

Common trait for names

Required Methods§

source

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

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

The argument must be a valid name.

source

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

Create a name from a precompiled format string.

Provided Methods§

source

fn from_str(name: &str) -> Self

Create a name from a borrowed string slice.

The argument must be a valid name.

source

fn from_string(name: String) -> Self

Create a name from a owned string.

The argument must be a valid name.

source

fn is_valid(&self) -> bool

source

fn is_empty(&self) -> bool

Object Safety§

This trait is not object safe.

Implementors§