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>
impl QMap<QMapPair_QString_QVariant>
pub fn cxx_contains(&self, key: &QString) -> bool
source§impl<T> QMap<T>where
T: QMapPair,
impl<T> QMap<T>where
T: QMapPair,
sourcepub fn contains(&self, key: &T::Key) -> bool
pub fn contains(&self, key: &T::Key) -> bool
Returns true if the map contains an item with the key; otherwise returns false.
sourcepub fn get(&self, key: &T::Key) -> Option<T::Value>
pub fn get(&self, key: &T::Key) -> Option<T::Value>
Returns the value associated with the key if it exists.
sourcepub fn get_or_default(&self, key: &T::Key) -> T::Value
pub fn get_or_default(&self, key: &T::Key) -> T::Value
Returns the value associated with the key or a default value.
sourcepub fn insert_clone(&mut self, key: &T::Key, value: &T::Value)
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.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the map contains no items; otherwise returns false.
Trait Implementations§
source§impl<T> ExternType for QMap<T>where
T: QMapPair,
impl<T> ExternType for QMap<T>where
T: QMapPair,
impl<T> Eq for QMap<T>
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> 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
Mutably borrows from an owned value. Read more