Struct gardiz::set::Set[][src]

pub struct Set<T> where
    T: Ord
{ /* fields omitted */ }
Expand description

The set of coordinates/vectors in a plane, optimized for being in the plane. Members of the set are Vec2<T>.

Implementations

Creates a new empty set.

Tests if the set is emtpy.

Returns the length of the set, i.e. how many Vec2 are stored in this set.

Tests if the set contains a given point.

Returns an iterator to the neighbours of a given point in a straight line in the given direction. The starting point is NOT included.

Returns an iterator to the neighbours of a given point in a straight line in the given direction. The starting point IS included.

Returns the nearest neighbour in a straight line of a given point in the the given direction.

Returns the furthest neighbour in a straight line of a given point in the given direction.

Inserts the given point in the set. Returns whether the insertion actually happened (i.e. the point was not already in the set).

Removes a point from the set. Returns whether the removal actuall happened (i.e. the point was in the set).

Returns an iterator over all the points in the set, in the direction of rows (first point is the lowest), i.e. all X are yielded before going to the next Y.

Returns an iterator over all the points in the set, in the direction of columns (first point is the lowest), i.e. all Y are yielded before going to the next X.

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

Deserialize this value from the given Serde deserializer. Read more

Extends a collection with the contents of an iterator. Read more

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

Extends a collection with exactly one element.

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

Reserves capacity in a collection for the given number of additional elements. Read more

Creates a value from an iterator. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. 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.

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.