Struct cxx_qt_lib::QMap

source ·
#[repr(C)]
pub struct QMap<T>
where T: QMapPair,
{ /* private fields */ }
Expand description

The QMap class is a template class that provides an associative array.

To use QMap with a custom pair, implement the QMapPair trait for T.

Implementations§

source§

impl QMap<QMapPair_QString_QVariant>

source

pub fn cxx_clear(&mut self)

source§

impl QMap<QMapPair_QString_QVariant>

source

pub fn cxx_contains(&self, key: &QString) -> bool

source§

impl<T> QMap<T>
where T: QMapPair,

source

pub fn clear(&mut self)

Removes all items from the map.

source

pub fn contains(&self, key: &T::Key) -> bool

Returns true if the map contains an item with the key; otherwise returns false.

source

pub fn get(&self, key: &T::Key) -> Option<T::Value>

Returns the value associated with the key if it exists.

source

pub fn get_or_default(&self, key: &T::Key) -> T::Value

Returns the value associated with the key or a default value.

source

pub fn insert_clone(&mut self, key: &T::Key, value: &T::Value)

Inserts a new item with the key and a value of value.

The key and value are references here so they can be opaque or trivial. Note that the key and value are cloned before inserting into the map.

source

pub fn is_empty(&self) -> bool

Returns true if the map contains no items; otherwise returns false.

source

pub fn iter(&self) -> Iter<'_, T>

An iterator visiting all key-value pairs in an arbitrary order. The iterator element type is (&T::Key, &T::Value).

source

pub fn len(&self) -> isize

Returns the number of items in the map.

source

pub fn remove(&mut self, key: &T::Key) -> bool

Removes all the items that have the key from the map.

source§

impl<T> QMap<T>
where T: QMapPair, T::Key: ExternType<Kind = Trivial>, T::Value: ExternType<Kind = Trivial>,

source

pub fn insert(&mut self, key: T::Key, value: T::Value)

Inserts a new item with the key and a value of value.

Trait Implementations§

source§

impl<T> Clone for QMap<T>
where T: QMapPair,

source§

fn clone(&self) -> Self

Constructs a copy of other.

1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T> Default for QMap<T>
where T: QMapPair,

source§

fn default() -> Self

Constructs an empty map.

source§

impl<T> Drop for QMap<T>
where T: QMapPair,

source§

fn drop(&mut self)

Destroys the map.

source§

impl<T> ExternType for QMap<T>
where T: QMapPair,

§

type Id = <T as QMapPair>::TypeId

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

type Kind = Trivial

source§

impl<T> PartialEq for QMap<T>
where T: QMapPair, T::Value: PartialEq,

source§

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

Returns true if both maps contain the same key value pairs

1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Eq for QMap<T>
where T: QMapPair, T::Value: Eq,

Auto Trait Implementations§

§

impl<T> Freeze for QMap<T>

§

impl<T> RefUnwindSafe for QMap<T>
where T: RefUnwindSafe,

§

impl<T> Send for QMap<T>
where T: Send,

§

impl<T> Sync for QMap<T>
where T: Sync,

§

impl<T> Unpin for QMap<T>
where T: Unpin,

§

impl<T> UnwindSafe for QMap<T>
where T: UnwindSafe,

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> 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,

§

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>,

§

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>,

§

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.