pub trait HaystackItem:
Debug
+ Default
+ Copy
+ Eq
+ Ord
+ Sealed {
// Required method
fn vec_from_str(value: &str) -> Vec<Self>;
}Expand description
A trait that represents an individual item that can be matched against a
Regex. The primary (and only) two implementors are char and u8.
§Sealed
This trait is sealed, preventing implementations because the regex! macro can’t produce
Regex types that match against any HaystackItem other than the default. If you need to match
against another item type and want to use this crate, you may as well fork it so that you don’t
have to write manual Matcher expressions.
Required Methods§
Sourcefn vec_from_str(value: &str) -> Vec<Self>
fn vec_from_str(value: &str) -> Vec<Self>
Creates a Vec of this item from the provided &str, used to convert string literals from
parsed regular expressions into individual HaystackItems that can be matched in a
haystack.
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.