EntWrapper

Trait EntWrapper 

Source
pub trait EntWrapper: Sized {
    // Required methods
    fn wrap_ent(ent: Box<dyn Ent>) -> Option<Self>;
    fn can_wrap_ent(ent: &dyn Ent) -> bool;
}
Expand description

Represents a wrapper around some set of ents that implement Ent, useful for edges that can return one of many different types that are variants of an enum

Required Methods§

Source

fn wrap_ent(ent: Box<dyn Ent>) -> Option<Self>

Returns Some(impl EntWrapper) if the wrapper is able to wrap around the given Ent trait object, otherwise returns None

Source

fn can_wrap_ent(ent: &dyn Ent) -> bool

Returns true if able to wrap the given ent trait object, otherwise returns false

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.

Implementors§