TryWithKind

Trait TryWithKind 

Source
pub trait TryWithKind {
    // Required method
    fn try_with_kind<T: EntityKind>(self) -> Option<T>;
}
Expand description

Extension trait used to safely cast an Entity into an EntityKind.

Required Methods§

Source

fn try_with_kind<T: EntityKind>(self) -> Option<T>

Checks if this Entity has the given EntityKind and returns it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TryWithKind for &EntityRef<'_>

Implementors§