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§
Sourcefn wrap_ent(ent: Box<dyn Ent>) -> Option<Self>
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
Sourcefn can_wrap_ent(ent: &dyn Ent) -> bool
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.