Skip to main content

QObjectMutPtr

Struct QObjectMutPtr 

Source
pub struct QObjectMutPtr(/* private fields */);
Expand description

A thin wrapper around *mut QObject. Using the ‘newtype’ idiom lets us implement ExternType for it, which wouldn’t be possible for pure *mut QObject itself.

Implementations§

Source§

impl QObjectMutPtr

Source

pub unsafe fn from_raw(raw: *mut QObject) -> Self

Create a new instance from a raw pointer.

§Safety

The pointer is passed to C++ as a QObject* and may be dereferenced there. This wrapper tracks neither ownership nor lifetime, so the object must outlive every use of the underlying QObject pointer (including any copy stored in a QVariant or QList).

Source

pub fn as_ptr(&self) -> *const QObject

Return a wrapped raw const pointer.

Source

pub fn as_mut_ptr(&self) -> *mut QObject

Return a wrapped raw mut pointer.

Source

pub fn into_raw(self) -> *mut QObject

Consume an object a return a wrapped raw mut pointer.

Trait Implementations§

Source§

impl Clone for QObjectMutPtr

Source§

fn clone(&self) -> QObjectMutPtr

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for QObjectMutPtr

Source§

impl Debug for QObjectMutPtr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for QObjectMutPtr

Source§

impl ExternType for QObjectMutPtr

Source§

type Id = (Q, O, b, j, e, c, t, M, u, t, P, t, r)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Trivial

Source§

impl PartialEq for QObjectMutPtr

Source§

fn eq(&self, other: &QObjectMutPtr) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl QListElement for QObjectMutPtr

Source§

type TypeId = (Q, L, i, s, t, __, Q, O, b, j, e, c, t, M, u, t, P, t, r)

Source§

fn append(list: &mut QList<Self>, value: Self)

Source§

fn append_clone(list: &mut QList<Self>, value: &Self)

Source§

fn clear(list: &mut QList<Self>)

Source§

fn clone(list: &QList<Self>) -> QList<Self>

Source§

fn contains(list: &QList<Self>, value: &Self) -> bool

Source§

fn default() -> QList<Self>

Source§

fn drop(list: &mut QList<Self>)

Source§

unsafe fn get_unchecked(list: &QList<Self>, pos: isize) -> &Self

Safety Read more
Source§

fn index_of(list: &QList<Self>, value: &Self) -> isize

Source§

fn insert(list: &mut QList<Self>, pos: isize, value: Self)

Source§

fn insert_clone(list: &mut QList<Self>, pos: isize, value: &Self)

Source§

fn len(list: &QList<Self>) -> isize

Source§

fn remove(list: &mut QList<Self>, pos: isize)

Source§

fn reserve(list: &mut QList<Self>, size: isize)

Source§

impl QVariantValue for QObjectMutPtr

Source§

fn can_convert(variant: &QVariant) -> bool

Source§

fn construct(value: &Self) -> QVariant

Source§

fn value_or_default(variant: &QVariant) -> Self

Source§

impl StructuralPartialEq for QObjectMutPtr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.