Struct cpp_map::PIterator[][src]

pub struct PIterator<K, V> where
    K: Debug,
    V: Debug
{ /* fields omitted */ }
Expand description

An effort to emulate a C++ std::map iterator in Rust. It will have functionality like: prev(), next(), get(), erase(), lower_bound(), replace_key()

Implementations

Initiates the pointer with a list, set current to the head of the list.

Initiates the pointer with a list, set index.

Returns a clone of the key at current position

Returns a clone of the value at current position

Move to the next element. Note that this is NOT a Rust iterator next() method. Always check validity of the iterator with is_ok() after next()

Move to the previous element Always check validity of the iterator with is_ok() after prev()

Move to the first element

Move to the last element

Return true if pointer has NOT moved past beginning or end of the list

Return true if pointer is at head position or if the list is empty

Return true if pointer is at tail position or if the list is empty

Replace current key. This will destroy the internal order of element if you replace an element with something out of order.

returns current index

Remove the current element and return it. Move current to the old prev value if exist. Else pick old next index. Note: make sure that there are no other Pointer objects at this position.

Returns a new Pointer positioned at the lower bound item. Lower bound item is the first element in the container whose key is not considered to go before position (i.e., either it is equivalent or goes after). Returns a Pointer where is_ok() returns false if no data is found

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.