Trait ObjectMethods

Source
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§

Source

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).

See C++ wxObject::GetClassInfo()’s documentation.

Source

fn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>>

Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.

See C++ wxObject::GetRefData()’s documentation.

Source

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.

See C++ wxObject::IsKindOf()’s documentation.

Source

fn is_same_as<O: ObjectMethods>(&self, obj: &O) -> bool

Returns true if this object has the same data pointer as obj.

See C++ wxObject::IsSameAs()’s documentation.

Source

fn ref_<O: ObjectMethods>(&self, clone: &O)

Makes this object refer to the data in clone.

See C++ wxObject::Ref()’s documentation.

Source

fn set_ref_data<O: ObjectRefDataMethods>(&self, data: Option<&O>)

Sets the wxObject::m_refData pointer.

See C++ wxObject::SetRefData()’s documentation.

Source

fn un_ref(&self)

Decrements the reference count in the associated data, and if it is zero, deletes the data.

See C++ wxObject::UnRef()’s documentation.

Source

fn un_share(&self)

This is the same of AllocExclusive() but this method is public.

See C++ wxObject::UnShare()’s documentation.

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.

Implementors§

Source§

impl<const OWNED: bool> ObjectMethods for EventIsOwned<OWNED>

Source§

impl<const OWNED: bool> ObjectMethods for EvtHandlerIsOwned<OWNED>

Source§

impl<const OWNED: bool> ObjectMethods for ObjectIsOwned<OWNED>

Source§

impl<const OWNED: bool> ObjectMethods for TimerEventIsOwned<OWNED>

Source§

impl<const OWNED: bool> ObjectMethods for TimerIsOwned<OWNED>