Trait IdentifierLike

Source
pub trait IdentifierLike
where Self: Clone + Display + FromStr + Deref<Target = str>,
{ // 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§

Source

fn new_unchecked(s: &str) -> Self
where 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.

Source

fn is_valid(s: &str) -> bool

Returns true if the provided string is a valid Identifier value, else false.

Provided Methods§

Source

fn any() -> Self

Construct an account identifier that represents any.

Source

fn is_any(&self) -> bool

Return true if this is simply the any wildcard, else false.

Source

fn has_wildcards(&self) -> bool

Returns true if this identifier contains any wildcard characeters, else false.

Source

fn is_plain(&self) -> bool

Return true if this identifier has no wildcards, 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.

Implementors§