Trait FetchTarget

Source
pub trait FetchTarget<'a, V>
where Self: Debug + Clone,
{ // Required methods fn index(&self) -> usize; fn fetch_values( &self, spec: &'a Specification, ) -> Result<&'a [V], TargetError<Self>>; fn fetch_values_mut( &self, spec: &'a mut Specification, ) -> Result<&'a mut [V], TargetError<Self>>; // Provided methods fn fetch(&self, spec: &'a Specification) -> Result<&'a V, TargetError<Self>> { ... } fn fetch_mut( &self, spec: &'a mut Specification, ) -> Result<&'a mut V, TargetError<Self>> { ... } }
Expand description

Trait that fetches a targeted item from a specification.

Required Methods§

Source

fn index(&self) -> usize

The index to access in the selected map.

Source

fn fetch_values( &self, spec: &'a Specification, ) -> Result<&'a [V], TargetError<Self>>

Fetch the map reference containing the targeted item.

Source

fn fetch_values_mut( &self, spec: &'a mut Specification, ) -> Result<&'a mut [V], TargetError<Self>>

Fetch the mutable map reference containing the targeted item.

Provided Methods§

Source

fn fetch(&self, spec: &'a Specification) -> Result<&'a V, TargetError<Self>>

Fetch a reference to the target from the specification.

Source

fn fetch_mut( &self, spec: &'a mut Specification, ) -> Result<&'a mut V, TargetError<Self>>

Fetch a mutable reference to the target from the specification.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§