#[repr(transparent)]
pub struct Syntax { /* private fields */ }
Expand description

Onig Syntax Wrapper

Each syntax dfines a flavour of regex syntax. This type allows interaction with the built-in syntaxes through the static accessor functions (Syntax::emacs(), Syntax::default() etc.) and the creation of custom syntaxes.

For a demonstration of creating a custom syntax see examples/syntax.rs in the main onig crate.

Implementations

Python syntax

Plain text syntax

POSIX Basic RE syntax

POSIX Extended RE syntax

Emacs syntax

Grep syntax

GNU regex syntax

Java (Sun java.util.regex) syntax

Perl syntax

Perl + named group syntax

Ruby syntax

Oniguruma Syntax

Default syntax (Ruby syntax)

Retrieve the operators for this syntax

Replace the operators for this syntax

Enable Operators for this Syntax

Updates the operators for this syntax to enable the chosen ones.

Disable Operators for this Syntax

Updates the operators for this syntax to remove the specified operators.

Retrieves the syntax behaviours

Overwrite the syntax behaviour for this syntax.

Enable a given behaviour for this syntax

Disable a given behaviour for this syntax

Retireve the syntax options for this syntax

Replace the syntax options for this syntax

Set a given meta character’s state

Arguments:

  • what: The meta character to update
  • meta: The value to set the meta character to

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

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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.