Struct statiki::Array[][src]

pub struct Array<T, const C: usize> { /* fields omitted */ }
Expand description

Static array with Vec-like interface

Implementations

Creates new empty instance

Returns length of vector.

Returns pointer to first element in underlying buffer.

Returns pointer to first element in underlying buffer.

Retrieves reference to element without checking boundaries.

Retrieves mutable reference to element without checking boundaries.

Returns immutable slice with current elements

Returns mutable slice with current elements

Shortens vector, keeping the first len elements.

Does nothing if len is greater or equal to vector length.

Returns whether vector is empty.

Returns vector capacity.

Sets new length of vector.

Notes:

Panics in debug mode only when new_len is greater than CAPACITY.

Removes all elements from vector

Appends element at the end, without checking capacity

Appends element at the end.

Returns Some(T) on capacity overflow

Unconditionally retrieves element from vector.

Pops element out of vector.

Removes element at index by swapping it with last element, and popping out.

Removes element at index by swapping it with last element, and popping out.

Note:

Panics when index is out of bounds

Resizes vector with provided value

If new_len is greater than len, the Array is extended by the difference, with each additional slot filled with value. If new_len is less than len, the Array is simply truncated.

Resizes vector with provided value

If new_len is greater than len, the Array is extended by the difference, with each additional slot filled with value. If new_len is less than len, the Array is simply truncated.

Note:

Panics if new_len is greater than CAPACITY

Resizes vector with default values.

If new_len is greater than len, the Array is extended by the difference, with each additional slot filled with value. If new_len is less than len, the Array is simply truncated.

Resizes vector with default values.

If new_len is greater than len, the Array is extended by the difference, with each additional slot filled with value. If new_len is less than len, the Array is simply truncated.

Note:

Panics if new_len is greater than CAPACITY

Trait Implementations

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

Write a buffer into this writer, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Like write, except that it writes from a slice of buffers. Read more

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

Determines if this Writer has an efficient write_vectored implementation. Read more

Attempts to write an entire buffer into this writer. Read more

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

Attempts to write multiple buffers into this writer. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a “by reference” adaptor for this instance of Write. 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 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.