[]Struct bench::eosio_token::SYMBOL_RE

struct SYMBOL_RE {
    __private_field: (),
}

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

impl Deref for SYMBOL_RE

type Target = RandRegex

The resulting type after dereferencing.

impl LazyStatic for SYMBOL_RE

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,