Fn fromvec vec
It is a logic error for an item to be modified in such a way that the item's ordering relative to any other item, as determined by the Ord trait, changes while it is in the heap. Creates an empty BinaryHeap with a specific capacity. This preallocates enough memory for capacity elements, so that the BinaryHeap does not have to be reallocated until it contains at least that many values.
Returns a mutable reference to the greatest item in the binary heap, or None if it is empty. Reserves the minimum capacity for exactly additional more elements to be inserted in the given BinaryHeap. Does nothing if the capacity is already sufficient. Note that the allocator may give the collection more space than it requests. Therefore capacity can not be relied upon to be precisely minimal. Prefer reserve if future insertions are expected.
Reserves capacity for at least additional more elements to be inserted in the BinaryHeap. The collection may reserve more space to avoid frequent reallocations. Removes the greatest item from the binary heap and returns it, or None if it is empty. Moves all the elements of other into self , leaving other empty. Creates an iterator from a value. Creates a consuming iterator, that is, one that moves each value out of the binary heap in arbitrary order. The binary heap cannot be used after calling this.
Place is the intermediate agent guarding the uninitialized state for Data. Formats the value using the given formatter. Creates a value from an iterator. Whichever end is closer to the removal point will be moved to make room, and all the affected elements will be moved to new positions. Returns None if index is out of bounds. Returns a newly allocated Self.
Moves all the elements of other into Self , leaving other empty. This method operates in place and preserves the order of the retained elements. Returns a copy of the value. Performs copy-assignment from source. Creates a value from an iterator. Extends a collection with the contents of an iterator. Feeds this value into the given [ Hasher ]. Feeds a slice of this type into the given [ Hasher ]. This method returns an Ordering between self and other. Compares and returns the maximum of two values.
Compares and returns the minimum of two values. This method returns an ordering between self and other values if one exists. Executes the destructor for this type. Creates an iterator from a value. A double-ended queue implemented with a growable ring buffer. Creates an empty VecDeque. VecDeque ; let vector: Creates an empty VecDeque with space for at least n elements.
Retrieves an element in the VecDeque by index. Element at index 0 is the front of the queue. Retrieves an element in the VecDeque mutably by index.
Swaps elements at indices i and j. Panics Panics if either index is out of bounds. Returns the number of elements the VecDeque can hold without reallocating. VecDeque ; let buf: Panics Panics if the new capacity overflows usize. VecDeque ; let mut buf: Shrinks the capacity of the VecDeque as much as possible.
Shortens the VecDeque , dropping excess elements from the back. Returns a front-to-back iterator. Returns a front-to-back iterator that returns mutable references. Returns a pair of slices which contain, in order, the contents of the VecDeque. Returns the number of elements in the VecDeque. Returns true if the VecDeque is empty. The element range is removed even if the iterator is not consumed until the end.