pub struct PriorityQueue<T: MoveType> {
pub entries: MoveVec<Entry<T>>,
}
Expand description
Struct representing a priority queue. The entries
vector represents a max
heap structure, where entries[0] is the root, entries[1] and entries[2] are the
left child and right child of the root, etc. More generally, the children of
entries[i] are at at i * 2 + 1 and i * 2 + 2. The max heap should have the invariant
that the parent node’s priority is always higher than its child nodes’ priorities.
Fields§
§entries: MoveVec<Entry<T>>
Implementations§
Source§impl<T: MoveType> PriorityQueue<T>
impl<T: MoveType> PriorityQueue<T>
Source§impl<T: MoveType> PriorityQueue<T>
impl<T: MoveType> PriorityQueue<T>
pub fn move_instance(self, t: <T as MoveType>::TypeTag) -> MoveInstance<Self>
pub fn type_(t: <T as MoveType>::TypeTag) -> PriorityQueueTypeTag<T>
Trait Implementations§
Source§impl<T: Clone + MoveType> Clone for PriorityQueue<T>
impl<T: Clone + MoveType> Clone for PriorityQueue<T>
Source§fn clone(&self) -> PriorityQueue<T>
fn clone(&self) -> PriorityQueue<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de, T: MoveType> Deserialize<'de> for PriorityQueue<T>
impl<'de, T: MoveType> Deserialize<'de> for PriorityQueue<T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: MoveType> Display for PriorityQueue<T>
impl<T: MoveType> Display for PriorityQueue<T>
Source§impl<T: MoveType> MoveStruct for PriorityQueue<T>
impl<T: MoveType> MoveStruct for PriorityQueue<T>
type StructTag = PriorityQueueTypeTag<T>
Source§impl<T: MoveType> MoveType for PriorityQueue<T>
impl<T: MoveType> MoveType for PriorityQueue<T>
Source§impl<T> Serialize for PriorityQueue<T>
impl<T> Serialize for PriorityQueue<T>
Source§impl<T: MoveType> StaticAddress for PriorityQueue<T>
impl<T: MoveType> StaticAddress for PriorityQueue<T>
Source§impl<T: MoveType> StaticModule for PriorityQueue<T>
impl<T: MoveType> StaticModule for PriorityQueue<T>
fn module() -> Identifier
Source§impl<T: MoveType> StaticName for PriorityQueue<T>
impl<T: MoveType> StaticName for PriorityQueue<T>
fn name() -> Identifier
Source§impl<T: MoveType + StaticTypeTag> StaticTypeParams for PriorityQueue<T>
impl<T: MoveType + StaticTypeTag> StaticTypeParams for PriorityQueue<T>
fn type_params() -> Vec<TypeTag>
Source§impl<T: MoveType> Tabled for PriorityQueue<T>
impl<T: MoveType> Tabled for PriorityQueue<T>
impl<T: Eq + MoveType> Eq for PriorityQueue<T>
impl<T: MoveType> StructuralPartialEq for PriorityQueue<T>
Auto Trait Implementations§
impl<T> Freeze for PriorityQueue<T>
impl<T> RefUnwindSafe for PriorityQueue<T>where
T: RefUnwindSafe,
impl<T> Send for PriorityQueue<T>where
T: Send,
impl<T> Sync for PriorityQueue<T>where
T: Sync,
impl<T> Unpin for PriorityQueue<T>where
T: Unpin,
impl<T> UnwindSafe for PriorityQueue<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more