pub trait TypeMatcher: Allocative + Debug + Clone + Sized + Send + Sync + 'static {
    // Required method
    fn matches(&self, value: Value<'_>) -> bool;

    // Provided method
    fn is_wildcard(&self) -> bool { ... }
}
Expand description

Runtime type matcher. E.g. when isinstance(1, int) is called, implementation of TypeMatcher for int is used.

Required Methods§

source

fn matches(&self, value: Value<'_>) -> bool

Check if the value matches the type.

Provided Methods§

source

fn is_wildcard(&self) -> bool

True if this matcher matches any value.

Object Safety§

This trait is not object safe.

Implementors§