pub enum StorageTier {
T1,
T2,
T3,
T4,
T5,
}Expand description
A fixed storage tier for a Pouch service.
Tiers are ordered: T1 < T2 < T3 < T4 < T5. A Pouch at tier T participates
in fragment placement for all tiers ≤ T (e.g. a T3 Pouch stores fragments
from T1, T2, and T3 files).
Variants§
T1
10 GiB — “Pebble”
T2
100 GiB — “Stone”
T3
500 GiB — “Boulder”
T4
1 TiB — “Rock”
T5
5 TiB — “Monolith”
Implementations§
Source§impl StorageTier
impl StorageTier
Sourcepub fn quota_bytes(self) -> u64
pub fn quota_bytes(self) -> u64
Return the exact quota in bytes for this tier.
Sourcepub fn participating_tiers(self) -> &'static [StorageTier]
pub fn participating_tiers(self) -> &'static [StorageTier]
Return all tiers from T1 up to and including self.
Used to determine which tier-buckets a Pouch participates in.
Sourcepub fn all() -> &'static [StorageTier]
pub fn all() -> &'static [StorageTier]
Return all defined tiers in ascending order.
Sourcepub fn for_file_size(bytes: u64) -> Option<Self>
pub fn for_file_size(bytes: u64) -> Option<Self>
Return the minimum tier that can hold a file of the given byte size.
Returns None if the file is too large even for T5.
Trait Implementations§
Source§impl Clone for StorageTier
impl Clone for StorageTier
Source§fn clone(&self) -> StorageTier
fn clone(&self) -> StorageTier
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 Debug for StorageTier
impl Debug for StorageTier
Source§impl<'de> Deserialize<'de> for StorageTier
impl<'de> Deserialize<'de> for StorageTier
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for StorageTier
impl Display for StorageTier
Source§impl FromStr for StorageTier
impl FromStr for StorageTier
Source§impl Ord for StorageTier
impl Ord for StorageTier
Source§fn cmp(&self, other: &StorageTier) -> Ordering
fn cmp(&self, other: &StorageTier) -> Ordering
1.21.0 · 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
Source§impl PartialEq for StorageTier
impl PartialEq for StorageTier
Source§impl PartialOrd for StorageTier
impl PartialOrd for StorageTier
Source§impl Serialize for StorageTier
impl Serialize for StorageTier
impl Copy for StorageTier
impl Eq for StorageTier
impl StructuralPartialEq for StorageTier
Auto Trait Implementations§
impl Freeze for StorageTier
impl RefUnwindSafe for StorageTier
impl Send for StorageTier
impl Sync for StorageTier
impl Unpin for StorageTier
impl UnwindSafe for StorageTier
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more