Struct ClassRef
pub struct ClassRef<'a, T>(/* private fields */)
where
T: IsClass;Expand description
Reference to the class struct of type T.
Methods from Deref<Target = Class<T>>§
pub fn type_(&self) -> Type
pub fn type_(&self) -> Type
Get the type id for this class.
This is not equivalent to T::static_type() but is the type of the subclass of T where
this class belongs to.
pub fn upcast_ref<U>(&self) -> &Class<U>
pub fn upcast_ref<U>(&self) -> &Class<U>
Casts this class to a reference to a parent type’s class.
pub fn downcast_ref<U>(&self) -> Option<&Class<U>>
pub fn downcast_ref<U>(&self) -> Option<&Class<U>>
Casts this class to a reference to a child type’s class or fails if this class is not implementing the child class.
Trait Implementations§
impl<T> Send for ClassRef<'_, T>where
T: IsClass,
impl<T> Sync for ClassRef<'_, T>where
T: IsClass,
Auto Trait Implementations§
impl<'a, T> Freeze for ClassRef<'a, T>
impl<'a, T> RefUnwindSafe for ClassRef<'a, T>
impl<'a, T> Unpin for ClassRef<'a, T>
impl<'a, T> UnwindSafe for ClassRef<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more