Skip to main content

ArrayProperty

Trait ArrayProperty 

Source
pub trait ArrayProperty: Length + InspectTypeInternal {
    type Type<'a>
       where Self: 'a;

    // Required methods
    fn set<'a>(&self, index: usize, value: impl Into<Self::Type<'a>>)
       where Self: 'a;
    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<'a> where Self: 'a

The type of the array entries.

Required Methods§

Source

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

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§