Struct BlockingQueue

Source
pub struct BlockingQueue<T, C, DualStore>
where T: IBranchFilter, DualStore: UserDualStore, C: Compare<Branch<T, DualStore>> + Clone,
{ /* private fields */ }
Expand description

Thread-safe queue that blocks de_q on empty

Implementations§

Source§

impl<T: IBranchFilter, C: Compare<Branch<T, DualStore>> + Clone, DualStore: UserDualStore> BlockingQueue<T, C, DualStore>

Source

pub fn new(compare_bound: C, compare_without_bound: C) -> Self

Create empty blocking queue

Source

pub fn now_has_bound(&self)

Source

pub fn add_job(&self, t: Branch<T, DualStore>)

push input on back of queue

  • unrecoverable if lock fails so just unwrap
Source

pub fn get_job(&self) -> Option<Branch<T, DualStore>>

pop element from front of queue

  • unrecoverable if lock fails so just unwrap
  • same for condition variable
Source

pub fn job_done(&self)

Source

pub fn flush_and_terminate(&self)

Source

pub fn copy_of_queue(&self) -> Vec<Branch<T, DualStore>>

Source

pub fn lowest_bound(&self) -> Option<f64>

Source

pub fn len(&self) -> usize

return number of elements in queue

Auto Trait Implementations§

§

impl<T, C, DualStore> !Freeze for BlockingQueue<T, C, DualStore>

§

impl<T, C, DualStore> RefUnwindSafe for BlockingQueue<T, C, DualStore>
where C: RefUnwindSafe,

§

impl<T, C, DualStore> Send for BlockingQueue<T, C, DualStore>
where C: Send, DualStore: Send, T: Send,

§

impl<T, C, DualStore> Sync for BlockingQueue<T, C, DualStore>
where C: Sync + Send, DualStore: Send, T: Send,

§

impl<T, C, DualStore> Unpin for BlockingQueue<T, C, DualStore>
where C: Unpin, DualStore: Unpin, T: Unpin,

§

impl<T, C, DualStore> UnwindSafe for BlockingQueue<T, C, DualStore>
where C: UnwindSafe,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V