[−]Struct bench::eosio_token::SYMBOL_RE
Fields
__private_field: ()Methods from Deref<Target = RandRegex>
pub const fn encoding(&self) -> Encoding
Obtains the narrowest string encoding this regex can produce.
pub const fn is_ascii(&self) -> bool
Checks if the regex can only produce ASCII strings.
Examples
let ascii_gen = rand_regex::Regex::compile("[0-9]+", 100).unwrap(); assert_eq!(ascii_gen.is_ascii(), true); let non_ascii_gen = rand_regex::Regex::compile(r"\d+", 100).unwrap(); assert_eq!(non_ascii_gen.is_ascii(), false);
pub const fn is_utf8(&self) -> bool
Checks if the regex can only produce valid Unicode strings.
Due to complexity of regex pattern, this method may have false negative (returning false but still always produce valid UTF-8)
Examples
let utf8_hir = regex_syntax::ParserBuilder::new() .unicode(false) .allow_invalid_utf8(true) .build() .parse(r"[\x00-\x7f]") .unwrap(); let utf8_gen = rand_regex::Regex::with_hir(utf8_hir, 100).unwrap(); assert_eq!(utf8_gen.is_utf8(), true); let non_utf8_hir = regex_syntax::ParserBuilder::new() .unicode(false) .allow_invalid_utf8(true) .build() .parse(r"[\x00-\xff]") .unwrap(); let non_utf8_gen = rand_regex::Regex::with_hir(non_utf8_hir, 100).unwrap(); assert_eq!(non_utf8_gen.is_utf8(), false);
pub const fn capacity(&self) -> usize
Returns the maximum length the string this regex can generate.
Examples
let gen = rand_regex::Regex::compile(r"\d{4}-\d{2}-\d{2}", 100).unwrap(); assert_eq!(gen.capacity(), 34); // each `\d` can occupy 4 bytes
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SYMBOL_RE
impl Send for SYMBOL_RE
impl Sync for SYMBOL_RE
impl Unpin for SYMBOL_RE
impl UnwindSafe for SYMBOL_RE
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,