Skip to main content

Metadata

Trait Metadata 

Source
pub trait Metadata {
    // Required method
    fn access<F, R>(&self, f: F) -> R
       where F: FnOnce(&Node<'_>) -> R;
}
Expand description

A trait for types that can provide access to a Node for the purpose of metadata retrieval.

Required Methods§

Source

fn access<F, R>(&self, f: F) -> R
where F: FnOnce(&Node<'_>) -> R,

Access the Node associated with this metadata provider.

§Arguments
  • f: A closure that takes a reference to a Node and returns a value of type R.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<M, H> Metadata for (M, H)
where M: Metadata,

Source§

fn access<F, R>(&self, f: F) -> R
where F: FnOnce(&Node<'_>) -> R,

Source§

impl<T> Metadata for &T
where T: Metadata,

Source§

fn access<F, R>(&self, f: F) -> R
where F: FnOnce(&Node<'_>) -> R,

Implementors§

Source§

impl Metadata for Node<'_>

Source§

impl<T> Metadata for Async<T>
where T: Metadata,