[][src]Struct yy_typings::utils::PathValidator

pub struct PathValidator { /* fields omitted */ }

Provides validation services for Gms2 Resource Names by running the Regex of r"[A-z_]\w+" over the input. For those who don't speak Regex, it passes for any input which contains only A-z, _, or 0-9 and which does not begin with 0-9.

Passes:

  • spr_player
  • _abc
  • _a12bc

Fails:

  • 0123abc
  • 9_
  • 5

Implementations

impl PathValidator[src]

pub fn new() -> PathValidator[src]

Create a new PathValidator, and initialize its regex. Use this stateful struct if you are going to be validating multiple paths. If only validating one path, feel free to use PathValidator::validate_path_once.

pub fn is_valid(&self, input: &str) -> bool[src]

Checks if the path given is a valid name for Gms2 Resources.

pub fn validate_path_once(input: &str) -> bool[src]

Checks if path is a valid name for Gms2 Resources. It is relatively inefficent, and does one allocations per call.

Trait Implementations

impl Clone for PathValidator[src]

impl Debug for PathValidator[src]

impl Default for PathValidator[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,