pub struct LookSet {
    pub bits: u16,
}
Expand description

A set of look-around assertions.

This is useful for efficiently tracking look-around assertions. For example, an Hir provides properties that return LookSets.

Fields

bits: u16

The underlying representation this set is exposed to make it possible to store it somewhere efficiently. The representation is that of a bitset, where each assertion occupies bit i where i = Look::as_repr().

Note that users of this internal representation must permit the full range of u16 values to be represented. For example, even if the current implementation only makes use of the 10 least significant bits, it may use more bits in a future semver compatible release.

Implementations

Create an empty set of look-around assertions.

Create a full set of look-around assertions.

This set contains all possible look-around assertions.

Create a look-around set containing the look-around assertion given.

This is a convenience routine for creating an empty set and inserting one look-around assertions.

Returns the total number of look-around assertions in this set.

Returns true if and only if this set is empty.

Returns true if and only if the given look-around assertion is in this set.

Returns true if and only if this set contains any anchor assertions. This includes both “start/end of haystack” and “start/end of line.”

Returns true if and only if this set contains any “start/end of haystack” anchors. This doesn’t include “start/end of line” anchors.

Returns true if and only if this set contains any “start/end of line” anchors. This doesn’t include “start/end of haystack” anchors. This includes both \n line anchors and CRLF (\r\n) aware line anchors.

Returns true if and only if this set contains any “start/end of line” anchors that only treat \n as line terminators. This does not include haystack anchors or CRLF aware line anchors.

Returns true if and only if this set contains any “start/end of line” anchors that are CRLF-aware. This doesn’t include “start/end of haystack” or “start/end of line-feed” anchors.

Returns true if and only if this set contains any word boundary or negated word boundary assertions. This include both Unicode and ASCII word boundaries.

Returns true if and only if this set contains any Unicode word boundary or negated Unicode word boundary assertions.

Returns true if and only if this set contains any ASCII word boundary or negated ASCII word boundary assertions.

Returns an iterator over all of the look-around assertions in this set.

Return a new set that is equivalent to the original, but with the given assertion added to it. If the assertion is already in the set, then the returned set is equivalent to the original.

Updates this set in place with the result of inserting the given assertion into this set.

Return a new set that is equivalent to the original, but with the given assertion removed from it. If the assertion is not in the set, then the returned set is equivalent to the original.

Updates this set in place with the result of removing the given assertion from this set.

Returns a new set that is the result of subtracting the given set from this set.

Updates this set in place with the result of subtracting the given set from this set.

Returns a new set that is the union of this and the one given.

Updates this set in place with the result of unioning it with the one given.

Returns a new set that is the intersection of this and the one given.

Updates this set in place with the result of intersecting it with the one given.

Return a LookSet from the slice given as a native endian 16-bit integer.

Panics

This panics if slice.len() < 2.

Write a LookSet as a native endian 16-bit integer to the beginning of the slice given.

Panics

This panics if slice.len() < 2.

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
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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.