Skip to main content

FCFSStorage

Struct FCFSStorage 

Source
pub struct FCFSStorage<T> { /* private fields */ }
Expand description

The FCFS queue storage.

Implementations§

Source§

impl<T> FCFSStorage<T>
where T: Clone,

Source

pub fn new() -> Self

Create a new storage.

Trait Implementations§

Source§

impl<T> QueueStorage for FCFSStorage<T>
where T: Clone + 'static,

Source§

type Priority = ()

The type of priorities, if push_with_priority is supported. Otherwise, it may define the () type.
Source§

type Item = T

The type of items.
Source§

fn is_empty(&self, p: &Point<'_>) -> bool

Test whether the storage is empty.
Source§

fn pop(&self, p: &Point<'_>) -> Option<Self::Item>

Pop the front item.
Source§

fn push(&self, item: Self::Item, p: &Point<'_>)

Push an item, or panic if only push_with_priority is supported.
Source§

fn push_with_priority( &self, _priority: Self::Priority, _item: Self::Item, _p: &Point<'_>, )

Push an item with the specified priority, or panic if only push is supported.
Source§

fn remove_by<F>(&self, predicate: F, p: &Point<'_>) -> Option<Self::Item>
where F: Fn(&Self::Item) -> bool + Clone,

Try to remove an item satisfying the specified predicate and return the item removed.
Source§

fn exists<F>(&self, predicate: F, p: &Point<'_>) -> bool
where F: Fn(&Self::Item) -> bool + Clone,

Detect whether there is an element satisfying the specified predicate in the queue.
Source§

fn find<F>(&self, predicate: F, p: &Point<'_>) -> Option<T>
where F: Fn(&Self::Item) -> bool + Clone, Self::Item: Clone,

Find an element satisfying the specified predicate.

Auto Trait Implementations§

§

impl<T> !Freeze for FCFSStorage<T>

§

impl<T> !RefUnwindSafe for FCFSStorage<T>

§

impl<T> !Send for FCFSStorage<T>

§

impl<T> !Sync for FCFSStorage<T>

§

impl<T> !UnwindSafe for FCFSStorage<T>

§

impl<T> Unpin for FCFSStorage<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for FCFSStorage<T>
where T: UnsafeUnpin,

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<S> BoxableQueueStorage for S
where S: QueueStorage,

Source§

type Priority = <S as QueueStorage>::Priority

The type of priorities, if push_with_priority is supported. Otherwise, it may define the () type.
Source§

type Item = <S as QueueStorage>::Item

The type of items.
Source§

fn is_empty(&self, p: &Point<'_>) -> bool

Test whether the storage is empty.
Source§

fn pop(&self, p: &Point<'_>) -> Option<<S as BoxableQueueStorage>::Item>

Pop the front item.
Source§

fn push(&self, item: <S as BoxableQueueStorage>::Item, p: &Point<'_>)

Push an item, or panic if only push_with_priority is supported.
Source§

fn push_with_priority( &self, priority: <S as BoxableQueueStorage>::Priority, item: <S as BoxableQueueStorage>::Item, p: &Point<'_>, )

Push an item with the specified priority, or panic if only push is supported.
Source§

fn remove_boxed_by( &self, predicate: Rc<dyn Fn(&<S as BoxableQueueStorage>::Item) -> bool>, p: &Point<'_>, ) -> Option<<S as BoxableQueueStorage>::Item>

Try to remove an item satisfying the specified predicate and return the item removed.
Source§

fn exists_boxed( &self, predicate: Rc<dyn Fn(&<S as BoxableQueueStorage>::Item) -> bool>, p: &Point<'_>, ) -> bool

Detect whether there is an element satisfying the specified predicate in the queue.
Source§

fn find_boxed( &self, predicate: Rc<dyn Fn(&<S as BoxableQueueStorage>::Item) -> bool>, p: &Point<'_>, ) -> Option<<S as BoxableQueueStorage>::Item>

Find an element satisfying the specified predicate.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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