Struct InterfaceRef
pub struct InterfaceRef<'a, T>(/* private fields */)
where
T: IsInterface;Expand description
Reference to a class struct of type T.
Methods from Deref<Target = Interface<T>>§
pub fn type_(&self) -> Type
pub fn type_(&self) -> Type
Get the type id for this interface.
This is equivalent to T::static_type().
pub fn instance_type(&self) -> Type
pub fn instance_type(&self) -> Type
Get the type id for the instance type of this interface.
This is not equivalent to T::static_type() but is the type id of the type this specific
interface belongs to.
pub fn parent(&self) -> Option<InterfaceRef<'_, T>>
pub fn parent(&self) -> Option<InterfaceRef<'_, T>>
Gets the parent interface struct, if any.
This returns the parent interface if a parent type of the instance type also implements the interface.
pub fn has_property(&self, property_name: &str) -> bool
pub fn has_property(&self, property_name: &str) -> bool
Check if the interface has a property property_name of the given type_.
pub fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
pub fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
Check if the interface has a property property_name of the given type_
or a subtype of it.
pub fn property_type(&self, property_name: &str) -> Option<Type>
pub fn property_type(&self, property_name: &str) -> Option<Type>
Get the type of the property property_name of this interface.
This returns None if the property does not exist.
pub fn find_property(&self, property_name: &str) -> Option<ParamSpec>
pub fn find_property(&self, property_name: &str) -> Option<ParamSpec>
Get the ParamSpec of the property property_name of this interface.
pub fn list_properties(&self) -> PtrSlice<ParamSpec>
pub fn list_properties(&self) -> PtrSlice<ParamSpec>
Return all ParamSpec of the properties of this interface.
Trait Implementations§
§impl<'a, T> Debug for InterfaceRef<'a, T>where
T: Debug + IsInterface,
impl<'a, T> Debug for InterfaceRef<'a, T>where
T: Debug + IsInterface,
§impl<T> Deref for InterfaceRef<'_, T>where
T: IsInterface,
impl<T> Deref for InterfaceRef<'_, T>where
T: IsInterface,
§impl<T> Drop for InterfaceRef<'_, T>where
T: IsInterface,
impl<T> Drop for InterfaceRef<'_, T>where
T: IsInterface,
impl<T> Send for InterfaceRef<'_, T>where
T: IsInterface,
impl<T> Sync for InterfaceRef<'_, T>where
T: IsInterface,
Auto Trait Implementations§
impl<'a, T> Freeze for InterfaceRef<'a, T>
impl<'a, T> RefUnwindSafe for InterfaceRef<'a, T>
impl<'a, T> Unpin for InterfaceRef<'a, T>
impl<'a, T> UnwindSafe for InterfaceRef<'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
§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> ⓘ
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> ⓘ
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