pub struct VolumeConfig {
pub name: String,
pub driver: String,
pub mount_point: String,
pub labels: HashMap<String, String>,
pub in_use_by: Vec<String>,
pub size_limit: u64,
pub created_at: String,
}Expand description
Configuration for a named volume.
Fields§
§name: StringVolume name (unique identifier).
driver: StringVolume driver (currently only “local” is supported).
mount_point: StringHost path where volume data is stored.
labels: HashMap<String, String>User-defined labels.
in_use_by: Vec<String>Box IDs currently using this volume.
size_limit: u64Maximum size in bytes (0 = unlimited).
created_at: StringCreation timestamp (RFC 3339).
Implementations§
Source§impl VolumeConfig
impl VolumeConfig
Sourcepub fn with_size_limit(name: &str, mount_point: &str, size_limit: u64) -> Self
pub fn with_size_limit(name: &str, mount_point: &str, size_limit: u64) -> Self
Create a new named volume with a size limit.
Sourcepub fn check_quota(&self) -> Result<u64, String>
pub fn check_quota(&self) -> Result<u64, String>
Check if the volume exceeds its size limit.
Returns Ok(current_size) if within quota, or Err with a message
if the volume exceeds its limit. Returns Ok(0) if no limit is set.
Trait Implementations§
Source§impl Clone for VolumeConfig
impl Clone for VolumeConfig
Source§fn clone(&self) -> VolumeConfig
fn clone(&self) -> VolumeConfig
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 VolumeConfig
impl Debug for VolumeConfig
Source§impl<'de> Deserialize<'de> for VolumeConfig
impl<'de> Deserialize<'de> for VolumeConfig
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 VolumeConfig
impl RefUnwindSafe for VolumeConfig
impl Send for VolumeConfig
impl Sync for VolumeConfig
impl Unpin for VolumeConfig
impl UnsafeUnpin for VolumeConfig
impl UnwindSafe for VolumeConfig
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