pub trait Fetch:
Send
+ Sync
+ FetchBytes {
type T;
// Required method
fn fetch(&self) -> FailFuture<'_, Self::T>;
// Provided methods
fn try_fetch_local(&self) -> Result<Option<Self::T>> { ... }
fn fetch_local(&self) -> Option<Self::T> { ... }
fn get(&self) -> Option<&Self::T> { ... }
fn get_mut(&mut self) -> Option<&mut Self::T> { ... }
fn get_mut_finalize(&mut self) { ... }
fn try_unwrap(self: Arc<Self>) -> Option<Self::T> { ... }
fn into_dyn_fetch<'a>(self) -> Arc<dyn Fetch<T = Self::T> + 'a> ⓘ
where Self: 'a + Sized { ... }
}Expand description
Application-facing traversal.
Required Associated Types§
Required Methods§
Sourcefn fetch(&self) -> FailFuture<'_, Self::T>
fn fetch(&self) -> FailFuture<'_, Self::T>
Main traversal method.
Provided Methods§
Sourcefn try_fetch_local(&self) -> Result<Option<Self::T>>
fn try_fetch_local(&self) -> Result<Option<Self::T>>
Attempt to fetch the object locally.
Generally this is either Fetch::get+Clone::clone or
FetchBytes::fetch_bytes_local+Parse::parse.
Sourcefn fetch_local(&self) -> Option<Self::T>
fn fetch_local(&self) -> Option<Self::T>
Fetch locally if possible. Typically this is just Fetch::get+Clone::clone.
Sourcefn get_mut(&mut self) -> Option<&mut Self::T>
fn get_mut(&mut self) -> Option<&mut Self::T>
Get a mutable reference to a locally stored object.
Fetch::get_mut_finalize must be called to restore the state even if no mutations were
made.
Sourcefn get_mut_finalize(&mut self)
fn get_mut_finalize(&mut self)
Restore the inner state after mutations completed (for example, [Hash] of what’s stored).
Sourcefn try_unwrap(self: Arc<Self>) -> Option<Self::T>
fn try_unwrap(self: Arc<Self>) -> Option<Self::T>
Attempt unwrapping the object stored locally.
Trait Implementations§
impl<T> Eq for dyn Fetch<T = T> + '_
impl<T> InlineOutput for dyn Fetch<T = T> + '_
Source§impl<T> PartialOrd for dyn Fetch<T = T> + '_
impl<T> PartialOrd for dyn Fetch<T = T> + '_
Source§impl<T> ToOutput for dyn Fetch<T = T> + '_
Even though we refer to something, we don’t know [Hash] for it. To match correctness, we don’t
implement Parse/ParseInline.
impl<T> ToOutput for dyn Fetch<T = T> + '_
Even though we refer to something, we don’t know [Hash] for it. To match correctness, we don’t
implement Parse/ParseInline.
Source§fn to_output(&self, _: &mut (impl ?Sized + Output))
fn to_output(&self, _: &mut (impl ?Sized + Output))
Output.Source§fn mangle_hash(&self) -> Hash
fn mangle_hash(&self) -> Hash
Tagged::HASH.Source§fn output<T: FromOutput<Output: Default>>(&self) -> T
fn output<T: FromOutput<Output: Default>>(&self) -> T
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".