pub trait IdentifierLike{
// Required methods
fn new_unchecked(s: &str) -> Self
where Self: Sized;
fn is_valid(s: &str) -> bool;
// Provided methods
fn any() -> Self { ... }
fn is_any(&self) -> bool { ... }
fn has_wildcards(&self) -> bool { ... }
fn is_plain(&self) -> bool { ... }
}
Expand description
This trait is implemented by the ResourceName
component types. It
represents a string-based identifier that is generally constructed using
FromStr::from_str
.
Required Methods§
Sourcefn new_unchecked(s: &str) -> Selfwhere
Self: Sized,
fn new_unchecked(s: &str) -> Selfwhere
Self: Sized,
Construct a new Identifier
from the provided string without checking it’s validity.
This can be a useful method to improve performance for statically, or well-known, values;
however, in general FromStr::from_str
should be used.
Provided Methods§
Sourcefn has_wildcards(&self) -> bool
fn has_wildcards(&self) -> bool
Returns true
if this identifier contains any wildcard characeters,
else false
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.