Struct cxx_qt_lib::QHash
source · #[repr(C)]pub struct QHash<T>where
T: QHashPair,{ /* private fields */ }
Expand description
The QHash class is a template class that provides a hash-table-based dictionary.
Note that this means that T needs to have a C++ global
qHash()
function.
To use QHash with a custom pair, implement the QHashPair
trait for T.
Implementations§
source§impl QHash<QHashPair_QString_QVariant>
impl QHash<QHashPair_QString_QVariant>
pub fn cxx_contains(&self, key: &QString) -> bool
source§impl QHash<QHashPair_i32_QByteArray>
impl QHash<QHashPair_i32_QByteArray>
pub fn cxx_contains(&self, key: &i32) -> bool
source§impl<T> QHash<T>where
T: QHashPair,
impl<T> QHash<T>where
T: QHashPair,
sourcepub fn contains(&self, key: &T::Key) -> bool
pub fn contains(&self, key: &T::Key) -> bool
Returns true if the hash 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 is a reference here so it can be opaque or trivial but note that the key and value is copied when being inserted into the hash.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the hash contains no items; otherwise returns false.
Trait Implementations§
source§impl<T> ExternType for QHash<T>where
T: QHashPair,
impl<T> ExternType for QHash<T>where
T: QHashPair,
source§impl<T> PartialEq for QHash<T>
impl<T> PartialEq for QHash<T>
impl<T> Eq for QHash<T>
Auto Trait Implementations§
impl<T> Freeze for QHash<T>
impl<T> RefUnwindSafe for QHash<T>where
T: RefUnwindSafe,
impl<T> Send for QHash<T>where
T: Send,
impl<T> Sync for QHash<T>where
T: Sync,
impl<T> Unpin for QHash<T>where
T: Unpin,
impl<T> UnwindSafe for QHash<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