pub enum FSType {
Bind,
Dev,
Fd,
Nfs,
Proc,
Tmp,
}Expand description
Filesystem types for mount actions.
These map to platform-specific mount implementations. Not all filesystem types are supported on all platforms; see individual variants for details.
§Filesystem Types
| Type | Aliases | Linux | macOS | NetBSD | illumos |
|---|---|---|---|---|---|
bind | lofs, loop, null | Yes | Yes | Yes | Yes |
dev | Yes | Yes | No | No | |
fd | Yes | No | Yes | Yes | |
nfs | Yes | Yes | Yes | Yes | |
proc | Yes | No | Yes | Yes | |
tmp | Yes | Yes | Yes | Yes |
Variants§
Bind
Bind mount from host filesystem.
Makes a directory from the host visible inside the sandbox. Use
opts = "ro" for read-only access.
Aliases: lofs, loop, null (for cross-platform compatibility).
| Platform | Implementation |
|---|---|
| Linux | mount -o bind |
| macOS | bindfs (requires installation) |
| NetBSD | mount_null |
| illumos | mount -F lofs |
Dev
Device filesystem.
Provides /dev device nodes inside the sandbox.
| Platform | Implementation |
|---|---|
| Linux | devtmpfs |
| macOS | devfs |
| NetBSD | Not supported. Use a cmd action with MAKEDEV instead. |
| illumos | Not supported. Use a bind mount of /dev instead. |
Fd
File descriptor filesystem.
Provides /dev/fd entries for accessing open file descriptors.
| Platform | Implementation |
|---|---|
| Linux | Bind mount of /dev/fd |
| macOS | Not supported. |
| NetBSD | mount_fdesc |
| illumos | mount -F fd |
Nfs
Network File System mount.
Mounts an NFS export inside the sandbox. The src field must be an
NFS path in the form host:/path.
| Platform | Implementation |
|---|---|
| Linux | mount -t nfs |
| macOS | mount_nfs |
| NetBSD | mount_nfs |
| illumos | mount -F nfs |
Proc
Process filesystem.
Provides /proc entries for process information. Required by many
build tools and commands.
| Platform | Implementation |
|---|---|
| Linux | mount -t proc |
| macOS | Not supported. |
| NetBSD | mount_procfs |
| illumos | mount -F proc |
Tmp
Temporary filesystem.
Memory-backed filesystem. Contents are lost when unmounted. Use
opts = "size=1G" to limit size (Linux, NetBSD). Useful for /tmp
and build directories.
| Platform | Implementation |
|---|---|
| Linux | mount -t tmpfs |
| macOS | mount_tmpfs |
| NetBSD | mount_tmpfs |
| illumos | mount -F tmpfs |
Trait Implementations§
impl StructuralPartialEq for FSType
Auto Trait Implementations§
impl Freeze for FSType
impl RefUnwindSafe for FSType
impl Send for FSType
impl Sync for FSType
impl Unpin for FSType
impl UnwindSafe for FSType
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
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> 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>
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>
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