Literal in regex_syntax::hir::literal - Rust (original) (raw)

pub struct Literal { /* private fields */ }

Expand description

A single literal extracted from an Hir expression.

A literal is composed of two things:

Source§

Source

Returns a new exact literal containing the bytes given.

Source

Returns a new inexact literal containing the bytes given.

Source

Returns the bytes in this literal.

Source

Yields ownership of the bytes inside this literal.

Note that this throws away whether the literal is “exact” or not.

Source

Returns the length of this literal in bytes.

Source

Returns true if and only if this literal has zero bytes.

Source

Returns true if and only if this literal is exact.

Source

Marks this literal as inexact.

Inexact literals can never be extended. For example,Seq::cross_forward will not extend inexact literals.

Source

Reverse the bytes in this literal.

Source

Extend this literal with the literal given.

If this literal is inexact, then this is a no-op.

Source

Trims this literal such that only the first len bytes remain. If this literal has fewer than len bytes, then it remains unchanged. Otherwise, the literal is marked as inexact.

Source

Trims this literal such that only the last len bytes remain. If this literal has fewer than len bytes, then it remains unchanged. Otherwise, the literal is marked as inexact.

Source§

Source§

Converts this type into a shared reference of the (usually inferred) input type.

Source§

Source§

Source§

Source§

Converts to this type from the input type.

Source§

Source§

Converts to this type from the input type.

Source§

Source§

Source§

Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Source§

Source§

This method returns an ordering between self and other values if one exists. Read more

1.0.0 · Source§

Tests less than (for self and other) and is used by the < operator. Read more

1.0.0 · Source§

Tests less than or equal to (for self and other) and is used by the<= operator. Read more

1.0.0 · Source§

Tests greater than (for self and other) and is used by the >operator. Read more

1.0.0 · Source§

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Source§

Source§

§

§

§

§

§

§