pub struct Mask { /* private fields */ }
Expand description

A mask which fixes the location of some Bells. Unfilled positions are usually denoted by 'x' (X is not a valid Bell name).

This can also be thought of as a music Pattern with no *s.

Implementations

Convert a Pattern into a Mask of the same Stage, expanding at most one * if it exists.

Creates a Mask that fully specifies a given Row

Creates a Mask that matches any Row of a given Stage (i.e. a mask where no Bell is fixed, written as xxxx...).

Creates a Mask that fixes the given Bells into their corresponding ‘home’ place.

Panics

Panics if any of the Bell are outside the Stage of this Mask.

Modifies self so that a Bell is fixed in its home position. Returns Err(()) if that Bell already appears in this Mask.

Modifies self so that a Bell is fixed in its home position, without checking if that Bell is already fixed in a different location.

Panics

Panics if the Bell is outside the Stage of this Mask.

Safety

This function is safe if b is not already fixed in self, or is already fixed to its home position.

Returns an Iterator over the indices of locations where this Mask contains an x

Returns the Stage of Row that this Mask matches

Tests whether or not a Row satisfies this Mask.

Returns the place of a Bell within this Mask. If that Bell isn’t found (either because it’s outside the Stage or because the Mask doesn’t specify a location) this returns None.

Updates this Mask so that a given Bell is required at a given place.

Updates this Mask so that a given Bell is required at a given place.

Safety

This function is safe if b is not already fixed in self, or is already fixed at the given place.

If this mask matches exactly one Row, then return that Row (otherwise None).

Returns true if the set of Rows satisfying self is a subset of those satisfying other. This implies that self is ‘stricter’ than other; for example, xx3456 is a subset of xxxx56.

Returns true if the set of Rows satisfying self is a strict subset of those satisfying other.

Check if there exist any Rows which can satisfy both Masks (i.e. the two Masks are ‘compatible’). a.is_compatible_with(b) equivalent to (but faster than) a.combine(b).is_some().

Creates a new Mask which matches precisely the Rows matched by both self and other. If self and other aren’t compatible, then such a Mask cannot exist and None is returned.

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

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Use a Row to transfigure the required Bells in a Mask. Mathematically, if r is a Row and m is a Mask and m matches some Row s, then r * m matches r * s.

Panics

Panics if the Stages of the Row and Mask don’t match.

The resulting type after applying the * operator.

Use a RowBuf to transfigure the required Bells in a Mask. Mathematically, if r is a RowBuf and m is a Mask and m matches some RowBuf s, then r * m matches r * s.

Panics

Panics if the Stages of the Row and Mask don’t match.

The resulting type after applying the * operator.

Use a RowBuf to transfigure the required Bells in a Mask. Mathematically, if r is a RowBuf and m is a Mask and m matches some RowBuf s, then r * m matches r * s.

Panics

Panics if the Stages of the Row and Mask don’t match.

The resulting type after applying the * operator.

Use a Row to permute the required Bells in a Mask. Mathematically, if r is a Row and m is a Mask and m matches some Row s, then m * r matches s * r.

Panics

Panics if the Stages of the Row and Mask don’t match.

The resulting type after applying the * operator.

Use a RowBuf to permute the required Bells in a Mask. Mathematically, if r is a RowBuf and m is a Mask and m matches some RowBuf s, then m * r matches s * r.

Panics

Panics if the Stages of the Row and Mask don’t match.

The resulting type after applying the * operator.

Use a RowBuf to permute the required Bells in a Mask. Mathematically, if r is a RowBuf and m is a Mask and m matches some RowBuf s, then m * r matches s * r.

Panics

Panics if the Stages of the Row and Mask don’t match.

The resulting type after applying the * operator.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

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

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

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. 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

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

Converts the given value to a String. 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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more