pub trait ExoticFact:
DynHash
+ DynEq
+ Send
+ Sync
+ Debug
+ DynClone
+ Downcast {
// Required method
fn buffer_sizes(&self) -> SmallVec<[TDim; 4]>;
// Provided methods
fn compatible_with(&self, other: &(dyn ExoticFact + 'static)) -> bool { ... }
fn clarify_dt_shape(&self) -> Option<(DatumType, SmallVec<[TDim; 4]>)> { ... }
fn mem_size(&self) -> TDim { ... }
}Required Methods§
fn buffer_sizes(&self) -> SmallVec<[TDim; 4]>
Provided Methods§
Sourcefn compatible_with(&self, other: &(dyn ExoticFact + 'static)) -> bool
fn compatible_with(&self, other: &(dyn ExoticFact + 'static)) -> bool
Whether or not it is acceptable for a Patch to substitute self by other.
In other terms, all operators consuming self MUST accept also accept other without being altered.
fn clarify_dt_shape(&self) -> Option<(DatumType, SmallVec<[TDim; 4]>)>
fn mem_size(&self) -> TDim
Implementations§
Source§impl dyn ExoticFact
impl dyn ExoticFact
Sourcepub fn is<__T>(&self) -> boolwhere
__T: ExoticFact,
pub fn is<__T>(&self) -> boolwhere
__T: ExoticFact,
Returns true if the trait object wraps an object of type __T.
Sourcepub fn downcast<__T>(
self: Box<dyn ExoticFact>,
) -> Result<Box<__T>, Box<dyn ExoticFact>>where
__T: ExoticFact,
pub fn downcast<__T>(
self: Box<dyn ExoticFact>,
) -> Result<Box<__T>, Box<dyn ExoticFact>>where
__T: ExoticFact,
Returns a boxed object from a boxed trait object if the underlying object is of type
__T. Returns the original boxed trait if it isn’t.
Sourcepub fn downcast_rc<__T>(
self: Rc<dyn ExoticFact>,
) -> Result<Rc<__T>, Rc<dyn ExoticFact>>where
__T: ExoticFact,
pub fn downcast_rc<__T>(
self: Rc<dyn ExoticFact>,
) -> Result<Rc<__T>, Rc<dyn ExoticFact>>where
__T: ExoticFact,
Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of
type __T. Returns the original Rc-ed trait if it isn’t.
Sourcepub fn downcast_ref<__T>(&self) -> Option<&__T>where
__T: ExoticFact,
pub fn downcast_ref<__T>(&self) -> Option<&__T>where
__T: ExoticFact,
Returns a reference to the object within the trait object if it is of type __T, or
None if it isn’t.
Sourcepub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>where
__T: ExoticFact,
pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>where
__T: ExoticFact,
Returns a mutable reference to the object within the trait object if it is of type
__T, or None if it isn’t.
Trait Implementations§
Source§impl<'clone> Clone for Box<dyn ExoticFact + 'clone>
impl<'clone> Clone for Box<dyn ExoticFact + 'clone>
Source§impl<T> From<T> for Box<dyn ExoticFact>where
T: ExoticFact,
impl<T> From<T> for Box<dyn ExoticFact>where
T: ExoticFact,
Source§fn from(v: T) -> Box<dyn ExoticFact>
fn from(v: T) -> Box<dyn ExoticFact>
Source§impl<'hash> Hash for dyn ExoticFact + 'hash
impl<'hash> Hash for dyn ExoticFact + 'hash
Source§impl<'hash> Hash for dyn ExoticFact + Send + 'hash
impl<'hash> Hash for dyn ExoticFact + Send + 'hash
Source§impl<'hash> Hash for dyn ExoticFact + Sync + 'hash
impl<'hash> Hash for dyn ExoticFact + Sync + 'hash
Source§impl<'eq> PartialEq<&Box<dyn ExoticFact + 'eq>> for Box<dyn ExoticFact + 'eq>
impl<'eq> PartialEq<&Box<dyn ExoticFact + 'eq>> for Box<dyn ExoticFact + 'eq>
Source§impl<'eq> PartialEq<&Box<dyn ExoticFact + Send + 'eq>> for Box<dyn ExoticFact + Send + 'eq>
impl<'eq> PartialEq<&Box<dyn ExoticFact + Send + 'eq>> for Box<dyn ExoticFact + Send + 'eq>
Source§impl<'eq> PartialEq<&Box<dyn ExoticFact + Send + Sync + 'eq>> for Box<dyn ExoticFact + Send + Sync + 'eq>
impl<'eq> PartialEq<&Box<dyn ExoticFact + Send + Sync + 'eq>> for Box<dyn ExoticFact + Send + Sync + 'eq>
Source§impl<'eq> PartialEq<&Box<dyn ExoticFact + Sync + 'eq>> for Box<dyn ExoticFact + Sync + 'eq>
impl<'eq> PartialEq<&Box<dyn ExoticFact + Sync + 'eq>> for Box<dyn ExoticFact + Sync + 'eq>
Source§impl<'eq> PartialEq for dyn ExoticFact + 'eq
impl<'eq> PartialEq for dyn ExoticFact + 'eq
Source§fn eq(&self, other: &(dyn ExoticFact + 'eq)) -> bool
fn eq(&self, other: &(dyn ExoticFact + 'eq)) -> bool
self and other values to be equal, and is used by ==.Source§impl<'eq> PartialEq for dyn ExoticFact + Send + 'eq
impl<'eq> PartialEq for dyn ExoticFact + Send + 'eq
Source§impl<'eq> PartialEq for dyn ExoticFact + Send + Sync + 'eq
impl<'eq> PartialEq for dyn ExoticFact + Send + Sync + 'eq
Source§impl<'eq> PartialEq for dyn ExoticFact + Sync + 'eq
impl<'eq> PartialEq for dyn ExoticFact + Sync + 'eq
impl<'eq> Eq for dyn ExoticFact + 'eq
impl<'eq> Eq for dyn ExoticFact + Send + 'eq
impl<'eq> Eq for dyn ExoticFact + Send + Sync + 'eq
impl<'eq> Eq for dyn ExoticFact + Sync + 'eq
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".