Skip to main content

DependencyQueue

Struct DependencyQueue 

Source
pub struct DependencyQueue<K: Eq + Hash, V> { /* private fields */ }

Implementations§

Source§

impl<K: Hash + Eq + Clone, V> DependencyQueue<K, V>

Source

pub fn new() -> DependencyQueue<K, V>

Creates a new dependency queue with 0 packages.

Source

pub fn queue( &mut self, fresh: Freshness, key: &K, value: V, dependencies: &[K], ) -> &mut V

Adds a new package to this dependency queue.

It is assumed that any dependencies of this package will eventually also be added to the dependency queue.

Source

pub fn queue_finished(&mut self)

All nodes have been added, calculate some internal metadata and prepare for dequeue.

Source

pub fn dequeue(&mut self) -> Option<(Freshness, K, V)>

Dequeues a package that is ready to be built.

A package is ready to be built when it has 0 un-built dependencies. If None is returned then no packages are ready to be built.

Source

pub fn is_empty(&self) -> bool

Returns whether there are remaining packages to be built.

Source

pub fn len(&self) -> usize

Returns the number of remaining packages to be built.

Source

pub fn finish(&mut self, key: &K, fresh: Freshness)

Indicate that a package has been built.

This function will update the dependency queue with this information, possibly allowing the next invocation of dequeue to return a package.

Trait Implementations§

Source§

impl<K: Debug + Eq + Hash, V: Debug> Debug for DependencyQueue<K, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: Hash + Eq + Clone, V> Default for DependencyQueue<K, V>

Source§

fn default() -> DependencyQueue<K, V>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<K, V> Freeze for DependencyQueue<K, V>
where HashMap<K, (HashSet<K>, V)>: Freeze, HashMap<K, HashSet<K>>: Freeze, HashSet<K>: Freeze, HashMap<K, usize>: Freeze,

§

impl<K, V> RefUnwindSafe for DependencyQueue<K, V>

§

impl<K, V> Send for DependencyQueue<K, V>
where HashMap<K, (HashSet<K>, V)>: Send, HashMap<K, HashSet<K>>: Send, HashSet<K>: Send, HashMap<K, usize>: Send,

§

impl<K, V> Sync for DependencyQueue<K, V>
where HashMap<K, (HashSet<K>, V)>: Sync, HashMap<K, HashSet<K>>: Sync, HashSet<K>: Sync, HashMap<K, usize>: Sync,

§

impl<K, V> Unpin for DependencyQueue<K, V>
where HashMap<K, (HashSet<K>, V)>: Unpin, HashMap<K, HashSet<K>>: Unpin, HashSet<K>: Unpin, HashMap<K, usize>: Unpin,

§

impl<K, V> UnsafeUnpin for DependencyQueue<K, V>

§

impl<K, V> UnwindSafe for DependencyQueue<K, V>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.