pub trait ObjectMethods: WxRustMethods {
// Provided methods
fn get_class_info(&self) -> Option<ClassInfoIsOwned<false>> { ... }
fn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>> { ... }
fn is_kind_of<C: ClassInfoMethods>(&self, info: Option<&C>) -> bool { ... }
fn is_same_as<O: ObjectMethods>(&self, obj: &O) -> bool { ... }
fn ref_<O: ObjectMethods>(&self, clone: &O) { ... }
fn set_ref_data<O: ObjectRefDataMethods>(&self, data: Option<&O>) { ... }
fn un_ref(&self) { ... }
fn un_share(&self) { ... }
}
Expand description
This trait represents C++ wxObject
class’s methods and inheritance.
See ObjectIsOwned
documentation for the class usage.
Provided Methods§
Sourcefn get_class_info(&self) -> Option<ClassInfoIsOwned<false>>
fn get_class_info(&self) -> Option<ClassInfoIsOwned<false>>
This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
Sourcefn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>>
fn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>>
Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
Sourcefn is_kind_of<C: ClassInfoMethods>(&self, info: Option<&C>) -> bool
fn is_kind_of<C: ClassInfoMethods>(&self, info: Option<&C>) -> bool
Determines whether this class is a subclass of (or the same class as) the given class.
Sourcefn is_same_as<O: ObjectMethods>(&self, obj: &O) -> bool
fn is_same_as<O: ObjectMethods>(&self, obj: &O) -> bool
Returns true if this object has the same data pointer as obj.
Sourcefn ref_<O: ObjectMethods>(&self, clone: &O)
fn ref_<O: ObjectMethods>(&self, clone: &O)
Makes this object refer to the data in clone.
Sourcefn set_ref_data<O: ObjectRefDataMethods>(&self, data: Option<&O>)
fn set_ref_data<O: ObjectRefDataMethods>(&self, data: Option<&O>)
Sets the wxObject::m_refData pointer.
Sourcefn un_ref(&self)
fn un_ref(&self)
Decrements the reference count in the associated data, and if it is zero, deletes the data.
This is the same of AllocExclusive() but this method is public.
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.