pub struct SharedGuestLayout { /* private fields */ }Expand description
Shared directory layout - identical structure on host and guest.
This struct represents the directory structure under:
- Host:
~/.boxlite/boxes/{box-id}/mounts/ - Guest:
/run/boxlite/shared/
The structure is:
{base}/
└── containers/
└── {cid}/ # SharedContainerLayout
├── overlayfs/{upper,work}
└── rootfs/§Example
use boxlite_shared::layout::SharedGuestLayout;
// Host usage
let host_layout = SharedGuestLayout::new("/home/user/.boxlite/boxes/abc123/mounts");
// Guest usage
let guest_layout = SharedGuestLayout::new("/run/boxlite/shared");
// Both have identical container paths relative to base
let host_container = host_layout.container("main");
let guest_container = guest_layout.container("main");
assert!(host_container.rootfs_dir().ends_with("containers/main/rootfs"));
assert!(guest_container.rootfs_dir().ends_with("containers/main/rootfs"));Implementations§
Sourcepub fn containers_dir(&self) -> PathBuf
pub fn containers_dir(&self) -> PathBuf
Containers directory: {base}/containers
Sourcepub fn container(&self, container_id: &str) -> SharedContainerLayout
pub fn container(&self, container_id: &str) -> SharedContainerLayout
Get layout for a specific container.
Trait Implementations§
Source§fn clone(&self) -> SharedGuestLayout
fn clone(&self) -> SharedGuestLayout
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 moreAuto Trait Implementations§
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request