pub fn match_type<T: 'static, R>(
value: &T,
patterns: &[(Box<dyn TypePattern<T>>, Box<dyn Fn(&T) -> R>)],
) -> Option<R>Expand description
Matches a value against a series of type patterns and handlers.
§Type Parameters
T- The type of the value to matchR- The return type of the pattern handlers
§Arguments
value- The value to match against patternspatterns- A slice of tuples containing patterns and their handlers
§Returns
Some(R)if a pattern matches and its handler succeedsNoneif no pattern matches