pub struct Field<T> { /* private fields */ }
Expand description

Vec<T> that represents a 2D field

Implementations

The base implementation of Field

Constructs a height by width field with data. Returns None if the size of data does not equal to height * width.

Returns the width of the field.

Returns the height of the field.

Returns a reference to an element.

Returns a mutable reference to an element.

Replaces an element with value and returns the element.

Returns the xy-coordinates representation of an index in the field.

Returns the index of a xy-coordinates representation in the field.

Constructs a height by width field, with each slot filled with the default value of its element type.

Constructs a height by width field, with each slot filled with value.

Returns a copy of an element.

Assigns a copy of a value to a slot.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. 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

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)

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.