Skip to main content
Provides read-only access to elements in a storage Vec. This trait enables retrieving elements and checking the vector’s length without modifying the underlying storage.

Signature

Trait functions

get

Returns a storage path to the element at the specified index, or None if out of bounds.

Signature

Examples

at

Returns a storage path to access the element at the specified index.

Panics

Panics if the index is out of bounds.

Examples

Signature

len

Returns the number of elements in the vector. The length is stored at the vector’s base storage address and is automatically updated when elements are appended.

Signature

Examples

Trait types

ElementType

Signature