pub struct Profile {
pub writable: Vec<PathBuf>,
pub hidden: Vec<PathBuf>,
pub read_only: Vec<PathBuf>,
pub network: Network,
pub tmp: PathBuf,
pub caches: Vec<PathBuf>,
pub unenforced: Unenforced,
}Expand description
One command’s confinement.
Fields§
§writable: Vec<PathBuf>Writable trees (the workspace first).
Unreadable trees.
read_only: Vec<PathBuf>Trees inside the writable ones that stay read-only (in place: the
checkout’s .git).
network: NetworkThe network.
tmp: PathBufThe private temporary directory (TMPDIR), writable.
caches: Vec<PathBuf>The person’s shared package caches (CACHES under home): read by
every command, written only by one that fetches (Profile::fetching).
unenforced: UnenforcedWhat this host cannot enforce and the profile leaves out
(sandbox::procage::fit).
Implementations§
Source§impl Profile
impl Profile
Sourcepub fn new(root: &Path, config: &Config, home: Option<&Path>) -> Self
pub fn new(root: &Path, config: &Config, home: Option<&Path>) -> Self
The profile for commands working in root, for the home directory home.
Sourcepub fn carve(self, read_only: &[PathBuf], hidden: &[PathBuf]) -> Self
pub fn carve(self, read_only: &[PathBuf], hidden: &[PathBuf]) -> Self
The same profile with read_only trees carved out of the writable
ones, and hidden added to the unreadable ones.
Sourcepub fn with_network(self, network: Network) -> Self
pub fn with_network(self, network: Network) -> Self
The same profile with another network. A command that may reach the network fetches: it may write the shared caches too.
Sourcepub fn fetching(self) -> Self
pub fn fetching(self) -> Self
The same profile, the shared caches writable: for what fills them —
a command with the network, speccoder’s prepare.
Sourcepub fn private_env(&self) -> Vec<(String, String)>
pub fn private_env(&self) -> Vec<(String, String)>
The environment a command in this profile starts with, beside its
own: the private TMPDIR, and — unless it fetches — a private cache
for what tools derive (XDG_CACHE_HOME, UV_CACHE_DIR, GOCACHE),
since the shared caches are read-only to it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Profile
impl<'de> Deserialize<'de> for Profile
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>,
impl Eq for Profile
impl StructuralPartialEq for Profile
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnsafeUnpin for Profile
impl UnwindSafe for Profile
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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