pub struct Resource<S>where
S: QueueStrategy,{ /* private fields */ }Expand description
Represents a simple resource that gathers its statistics.
Implementations§
Source§impl<S> Resource<S>where
S: QueueStrategy,
impl<S> Resource<S>where
S: QueueStrategy,
Sourcepub fn new(strategy: S, count: isize) -> NewResource<S>
pub fn new(strategy: S, count: isize) -> NewResource<S>
Create a new resource by the specified queue storage and initial count, where the latter becomes the capacity as well.
Sourcepub fn new_with_max_count(
strategy: S,
count: isize,
max_count: Option<isize>,
) -> NewResource<S>
pub fn new_with_max_count( strategy: S, count: isize, max_count: Option<isize>, ) -> NewResource<S>
Create a new resource by the specified queue storage, initial count and optional maximum count, i.e. capacity.
Trait Implementations§
Source§impl<S> PartialEq for Resource<S>where
S: QueueStrategy,
impl<S> PartialEq for Resource<S>where
S: QueueStrategy,
impl<S> Eq for Resource<S>where
S: QueueStrategy,
Auto Trait Implementations§
impl<S> Freeze for Resource<S>
impl<S> !RefUnwindSafe for Resource<S>
impl<S> !Send for Resource<S>
impl<S> !Sync for Resource<S>
impl<S> Unpin for Resource<S>
impl<S> !UnwindSafe for Resource<S>
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