pub struct AdditionalDir(/* private fields */);Expand description
A single entry in the acp.additional_directories policy allowlist.
Constructed via Self::parse, which:
- Rejects any path containing a
..component (component-aware check). - Expands a leading
~to the user’s home directory. - Calls
std::fs::canonicalize. - Rejects paths prefixed by
/proc,/sys,{HOME}/.ssh,{HOME}/.gnupg, or{HOME}/.aws.
§Examples
use zeph_config::AdditionalDir;
let dir = AdditionalDir::parse("/tmp/workspace").unwrap();
assert!(dir.as_path().is_absolute());
assert!(AdditionalDir::parse("/proc/self").is_err());Implementations§
Source§impl AdditionalDir
impl AdditionalDir
Sourcepub fn parse(
raw: impl Into<PathBuf>,
) -> Result<AdditionalDir, AdditionalDirError>
pub fn parse( raw: impl Into<PathBuf>, ) -> Result<AdditionalDir, AdditionalDirError>
Parse and validate a raw path as a policy allowlist entry.
§Errors
Returns AdditionalDirError on traversal, reserved prefix, or canonicalization failure.
Trait Implementations§
Source§impl Clone for AdditionalDir
impl Clone for AdditionalDir
Source§fn clone(&self) -> AdditionalDir
fn clone(&self) -> AdditionalDir
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 AdditionalDir
impl Debug for AdditionalDir
Source§impl<'de> Deserialize<'de> for AdditionalDir
impl<'de> Deserialize<'de> for AdditionalDir
Source§fn deserialize<D>(
d: D,
) -> Result<AdditionalDir, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
d: D,
) -> Result<AdditionalDir, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AdditionalDir
impl Display for AdditionalDir
Source§impl PartialEq for AdditionalDir
impl PartialEq for AdditionalDir
Source§impl Serialize for AdditionalDir
impl Serialize for AdditionalDir
Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for AdditionalDir
impl StructuralPartialEq for AdditionalDir
Auto Trait Implementations§
impl Freeze for AdditionalDir
impl RefUnwindSafe for AdditionalDir
impl Send for AdditionalDir
impl Sync for AdditionalDir
impl Unpin for AdditionalDir
impl UnsafeUnpin for AdditionalDir
impl UnwindSafe for AdditionalDir
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<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
Compare self to
key and return true if they are equal.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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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 moreSource§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::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.