pub trait FetchTarget<'a, V>{
// 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§
Sourcefn fetch_values(
&self,
spec: &'a Specification,
) -> Result<&'a [V], TargetError<Self>>
fn fetch_values( &self, spec: &'a Specification, ) -> Result<&'a [V], TargetError<Self>>
Fetch the map reference containing the targeted item.
Sourcefn fetch_values_mut(
&self,
spec: &'a mut Specification,
) -> Result<&'a mut [V], TargetError<Self>>
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§
Sourcefn fetch(&self, spec: &'a Specification) -> Result<&'a V, TargetError<Self>>
fn fetch(&self, spec: &'a Specification) -> Result<&'a V, TargetError<Self>>
Fetch a reference to the target from the specification.
Sourcefn fetch_mut(
&self,
spec: &'a mut Specification,
) -> Result<&'a mut V, TargetError<Self>>
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.