Trait QHashPair

Source
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§

Source

fn clear(hash: &mut QHash<Self>)

Source

fn clone(hash: &QHash<Self>) -> QHash<Self>

Source

fn contains(hash: &QHash<Self>, key: &Self::Key) -> bool

Source

fn default() -> QHash<Self>

Source

fn drop(hash: &mut QHash<Self>)

Source

fn get_or_default(hash: &QHash<Self>, key: &Self::Key) -> Self::Value

Source

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.

Source

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.

Source

fn insert(hash: &mut QHash<Self>, key: Self::Key, value: Self::Value)
where Self::Key: ExternType<Kind = Trivial>, Self::Value: ExternType<Kind = Trivial>,

Source

fn insert_clone(hash: &mut QHash<Self>, key: &Self::Key, value: &Self::Value)

Source

fn len(hash: &QHash<Self>) -> isize

Source

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.

Implementors§

Source§

impl QHashPair for QHashPair_QString_QVariant

Source§

type Key = QString

Source§

type Value = QVariant

Source§

type TypeId = (Q, H, a, s, h, __, Q, S, t, r, i, n, g, __, Q, V, a, r, i, a, n, t)

Source§

impl QHashPair for QHashPair_i32_QByteArray

Source§

type Key = i32

Source§

type Value = QByteArray

Source§

type TypeId = (Q, H, a, s, h, __, i, _3, _2, __, Q, B, y, t, e, A, r, r, a, y)