pub trait ArrayProperty: Length + InspectTypeInternal {
    type Type;

    // Required methods
    fn set(&self, index: usize, value: impl Into<Self::Type>);
    fn clear(&self);

    // Provided method
    fn atomic_update<R, F: FnOnce(&Self) -> R>(&self, update_fn: F) -> R { ... }
}
Expand description

Trait implemented by all array properties providing common operations on arrays.

Required Associated Types§

source

type Type

The type of the array entries.

Required Methods§

source

fn set(&self, index: usize, value: impl Into<Self::Type>)

Sets the array value to value at the given index.

source

fn clear(&self)

Sets all slots of the array to 0 and releases any references.

Provided Methods§

source

fn atomic_update<R, F: FnOnce(&Self) -> R>(&self, update_fn: F) -> R

Takes a function to execute as under a single lock of the Inspect VMO. This function receives a reference to the ArrayProperty on which it is called.

Object Safety§

This trait is not object safe.

Implementors§