pub trait QHashPair: Sized {
type Key;
type Value;
type TypeId;
// Required methods
fn clear(hash: &mut QHash<Self>);
fn clone(hash: &QHash<Self>) -> QHash<Self>;
fn contains(hash: &QHash<Self>, key: &Self::Key) -> bool;
fn default() -> QHash<Self>;
fn drop(hash: &mut QHash<Self>);
fn get_or_default(hash: &QHash<Self>, key: &Self::Key) -> Self::Value;
unsafe fn get_unchecked_key(hash: &QHash<Self>, pos: isize) -> &Self::Key;
unsafe fn get_unchecked_value(
hash: &QHash<Self>,
pos: isize,
) -> &Self::Value;
fn insert(hash: &mut QHash<Self>, key: Self::Key, value: Self::Value)
where Self::Key: ExternType<Kind = Trivial>,
Self::Value: ExternType<Kind = Trivial>;
fn insert_clone(
hash: &mut QHash<Self>,
key: &Self::Key,
value: &Self::Value,
);
fn len(hash: &QHash<Self>) -> isize;
fn remove(hash: &mut QHash<Self>, key: &Self::Key) -> bool;
}
Expand description
Trait implementation for a pair in a QHash
.
Required Associated Types§
Required Methods§
fn clear(hash: &mut QHash<Self>)
fn clone(hash: &QHash<Self>) -> QHash<Self>
fn contains(hash: &QHash<Self>, key: &Self::Key) -> bool
fn default() -> QHash<Self>
fn drop(hash: &mut QHash<Self>)
fn get_or_default(hash: &QHash<Self>, key: &Self::Key) -> Self::Value
Sourceunsafe fn get_unchecked_key(hash: &QHash<Self>, pos: isize) -> &Self::Key
unsafe fn get_unchecked_key(hash: &QHash<Self>, pos: isize) -> &Self::Key
§Safety
Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
Sourceunsafe fn get_unchecked_value(hash: &QHash<Self>, pos: isize) -> &Self::Value
unsafe fn get_unchecked_value(hash: &QHash<Self>, pos: isize) -> &Self::Value
§Safety
Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
fn insert(hash: &mut QHash<Self>, key: Self::Key, value: Self::Value)
fn insert_clone(hash: &mut QHash<Self>, key: &Self::Key, value: &Self::Value)
fn len(hash: &QHash<Self>) -> isize
fn remove(hash: &mut QHash<Self>, key: &Self::Key) -> bool
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.