Volume
Named volumes are managed by microsandbox and stored at~/.microsandbox/volumes/<name>/. They persist independently of any sandbox.
Volume::builder()
.quota() to set a storage limit, then .create() to finalize.
Parameters
| Name | Type | Description |
|---|---|---|
| name | impl Into<String> | Volume name (e.g. "pip-cache") |
| Type | Description |
|---|---|
VolumeBuilder | Builder with .quota() and .create() |
Volume::get()
| Name | Type | Description |
|---|---|---|
| name | &str | Volume name |
| Type | Description |
|---|---|
VolumeHandle | Handle for host-side operations |
Volume::list()
| Type | Description |
|---|---|
Vec<VolumeHandle> | All volume handles |
Volume::remove()
| Name | Type | Description |
|---|---|---|
| name | &str | Volume name |
VolumeBuilder
Builder for creating a named volume.create()
| Type | Description |
|---|---|
Volume | The created volume |
quota()
| Name | Type | Description |
|---|---|---|
| mib | u64 | Quota in MiB |
MountBuilder
Builder for configuring a volume mount. Used inSandboxBuilder::volume(path, |v| v...).
bind()
| Name | Type | Description |
|---|---|---|
| host_path | impl Into<PathBuf> | Directory path on the host |
named()
Volume::builder()).
Parameters
| Name | Type | Description |
|---|---|---|
| name | impl Into<String> | Volume name |
readonly()
size()
| Name | Type | Description |
|---|---|---|
| mib | impl Into<Mebibytes> | Size limit in MiB |
tmpfs()
Types
VolumeHandle
Handle for interacting with a named volume from the host side.| Property / Method | Type | Description |
|---|---|---|
| fs() | VolumeFsHandle | Host-side filesystem access - read and write files without a running sandbox |
| name() | &str | Volume name |
| remove() | () | Delete this volume from disk |