pub struct IndexedInjector<T, I: Injector<InputItem = Indexed<T>>> { /* private fields */ }Expand description
Wraps the injected item with an atomic index which is incremented on push.
Implementations§
Source§impl<T, I> IndexedInjector<T, I>
impl<T, I> IndexedInjector<T, I>
pub fn new_globally_indexed(injector: <Self as Injector>::Inner) -> Self
pub fn global_reset()
Trait Implementations§
Source§impl<T: Clone, I: Clone + Injector<InputItem = Indexed<T>>> Clone for IndexedInjector<T, I>
impl<T: Clone, I: Clone + Injector<InputItem = Indexed<T>>> Clone for IndexedInjector<T, I>
Source§fn clone(&self) -> IndexedInjector<T, I>
fn clone(&self) -> IndexedInjector<T, I>
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<T, I: Injector<InputItem = Indexed<T>>> Injector for IndexedInjector<T, I>
impl<T, I: Injector<InputItem = Indexed<T>>> Injector for IndexedInjector<T, I>
type InputItem = T
type Inner = I
type Context = &'static AtomicU32
fn new(injector: Self::Inner, counter: Self::Context) -> Self
fn wrap( &self, item: Self::InputItem, ) -> Result<<Self::Inner as Injector>::InputItem, WorkerError>
fn inner(&self) -> &Self::Inner
fn push(&self, item: Self::InputItem) -> Result<(), WorkerError>
Auto Trait Implementations§
impl<T, I> Freeze for IndexedInjector<T, I>where
I: Freeze,
impl<T, I> RefUnwindSafe for IndexedInjector<T, I>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> Send for IndexedInjector<T, I>
impl<T, I> Sync for IndexedInjector<T, I>
impl<T, I> Unpin for IndexedInjector<T, I>
impl<T, I> UnsafeUnpin for IndexedInjector<T, I>where
I: UnsafeUnpin,
impl<T, I> UnwindSafe for IndexedInjector<T, I>where
I: UnwindSafe,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformExt for T
impl<T> TransformExt for T
fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q
fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T
Source§fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
Example Read more