pub struct AdmittedSize(/* private fields */);Expand description
The size of a file the pipeline admitted: the bytes a QuotaPermit
reserved for it.
A read-only, copyable view handed to an EntrySink so
it can tell a size the quota tracker already charged from any other number.
Only the pipeline can build one: the field is private and the sole
constructor spends a permit.
§Examples
use exarch_core::AdmittedSize;
fn capacity_hint(size: AdmittedSize) -> usize {
usize::try_from(size.get().min(1 << 16)).unwrap_or(0)
}Implementations§
Trait Implementations§
Source§impl Clone for AdmittedSize
impl Clone for AdmittedSize
impl Copy for AdmittedSize
Source§impl Debug for AdmittedSize
impl Debug for AdmittedSize
impl Eq for AdmittedSize
Source§impl Hash for AdmittedSize
impl Hash for AdmittedSize
Source§impl Ord for AdmittedSize
impl Ord for AdmittedSize
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for AdmittedSize
impl PartialEq for AdmittedSize
Source§impl PartialOrd for AdmittedSize
impl PartialOrd for AdmittedSize
impl StructuralPartialEq for AdmittedSize
Auto Trait Implementations§
impl Freeze for AdmittedSize
impl RefUnwindSafe for AdmittedSize
impl Send for AdmittedSize
impl Sync for AdmittedSize
impl Unpin for AdmittedSize
impl UnsafeUnpin for AdmittedSize
impl UnwindSafe for AdmittedSize
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.