pub struct StorageQuota {
pub total_bytes: u64,
pub total_chunks: u64,
pub quota_limit: u64,
}Expand description
Storage quota and usage statistics
Fields§
§total_bytes: u64Total bytes currently stored
total_chunks: u64Total number of chunks stored
quota_limit: u64Maximum allowed storage in bytes (0 = unlimited)
Implementations§
Source§impl StorageQuota
impl StorageQuota
Sourcepub fn has_space(&self, bytes: u64) -> bool
pub fn has_space(&self, bytes: u64) -> bool
Check if quota is available for storing additional bytes
Sourcepub fn remaining_bytes(&self) -> u64
pub fn remaining_bytes(&self) -> u64
Get remaining space in bytes
Sourcepub fn usage_percentage(&self) -> f64
pub fn usage_percentage(&self) -> f64
Get usage percentage (0-100)
Sourcepub fn is_nearly_full(&self) -> bool
pub fn is_nearly_full(&self) -> bool
Check if quota is nearly full (>90%)
Trait Implementations§
Source§impl Clone for StorageQuota
impl Clone for StorageQuota
Source§fn clone(&self) -> StorageQuota
fn clone(&self) -> StorageQuota
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 StorageQuota
impl Debug for StorageQuota
Source§impl Default for StorageQuota
impl Default for StorageQuota
Source§impl<'de> Deserialize<'de> for StorageQuota
impl<'de> Deserialize<'de> for StorageQuota
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
Auto Trait Implementations§
impl Freeze for StorageQuota
impl RefUnwindSafe for StorageQuota
impl Send for StorageQuota
impl Sync for StorageQuota
impl Unpin for StorageQuota
impl UnwindSafe for StorageQuota
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