pub trait MatchName {
    // Required methods
    fn match_name<T>(&self, name: &str) -> Option<&T>;
    fn match_name_mut<T>(&mut self, name: &str) -> Option<&mut T>;
}
Expand description

Match for a name and return the value

Note

This operation may not be 100% accurate with Rust stable, see the notes for type_eq (in nightly, it uses specialization).

Required Methods§

source

fn match_name<T>(&self, name: &str) -> Option<&T>

Match for a name and return the borrowed value

source

fn match_name_mut<T>(&mut self, name: &str) -> Option<&mut T>

Match for a name and return the mut borrowed value

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MatchName for ()

source§

fn match_name<T>(&self, _name: &str) -> Option<&T>

source§

fn match_name_mut<T>(&mut self, _name: &str) -> Option<&mut T>

source§

impl<Head, Tail> MatchName for (Head, Tail)
where Head: Named, Tail: MatchName,

source§

fn match_name<T>(&self, name: &str) -> Option<&T>

source§

fn match_name_mut<T>(&mut self, name: &str) -> Option<&mut T>

Implementors§