Skip to main content

MatchName

Trait MatchName 

Source
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

Required Methods§

Source

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

👎Deprecated:

Use .handle and either .get (fallible access) or [] (infallible access) instead

Match for a name and return the borrowed value

Source

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

👎Deprecated:

Use .handle and either .get (fallible access) or [] (infallible access) instead

Match for a name and return the mut borrowed value

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 MatchName for ()

Available on crate feature alloc only.
Source§

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

👎Deprecated:

Use .handle and either .get (fallible access) or [] (infallible access) instead

Source§

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

👎Deprecated:

Use .handle and either .get (fallible access) or [] (infallible access) instead

Source§

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

Available on crate feature alloc only.
Source§

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

👎Deprecated:

Use .handle and either .get (fallible access) or [] (infallible access) instead

Source§

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

👎Deprecated:

Use .handle and either .get (fallible access) or [] (infallible access) instead

Implementors§