pub trait MatchFirstType {
    // Required methods
    fn match_first_type<T: 'static>(&self) -> Option<&T>;
    fn match_first_type_mut<T: 'static>(&mut self) -> Option<&mut T>;
}
Expand description

Returns the first element with the given type

Required Methods§

source

fn match_first_type<T: 'static>(&self) -> Option<&T>

Returns the first element with the given type as borrow, or Option::None

source

fn match_first_type_mut<T: 'static>(&mut self) -> Option<&mut T>

Returns the first element with the given type as mutable borrow, or Option::None

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MatchFirstType for ()

source§

fn match_first_type<T: 'static>(&self) -> Option<&T>

source§

fn match_first_type_mut<T: 'static>(&mut self) -> Option<&mut T>

source§

impl<Head, Tail> MatchFirstType for (Head, Tail)
where Head: 'static, Tail: MatchFirstType,

source§

fn match_first_type<T: 'static>(&self) -> Option<&T>

source§

fn match_first_type_mut<T: 'static>(&mut self) -> Option<&mut T>

Implementors§