Struct yy_typings::utils::ResourceNameValidator[][src]

pub struct ResourceNameValidator { /* fields omitted */ }
Expand description

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

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.

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

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.