pub enum WriteTargetError {
CrossProduct {
path: PathBuf,
native_root: PathBuf,
},
Unpinned {
path: PathBuf,
component: String,
},
Unpinnable {
path: PathBuf,
detail: String,
},
SymlinkEscape {
path: PathBuf,
resolved: PathBuf,
native_root: PathBuf,
},
}Expand description
Why a candidate write target was refused.
Why: each refusal has a different fix — “you aimed at the wrong product’s
directory”, “something on this path is a symlink out of the tree”, “the
directory you validated was swapped out from under the write” — and
collapsing them into one string would hide which.
What: WriteTargetError::CrossProduct for a path outside
<project>/.trusty-code/; WriteTargetError::SymlinkEscape for a path
whose nearest existing ancestor resolves outside it;
WriteTargetError::Unpinned and WriteTargetError::Unpinnable for the
handle-based writes in write_dir (#7779).
Test: paths::tests::write_to_claude_dir_is_refused,
paths::tests::symlinked_native_subdir_escape_is_refused,
paths::write_dir_tests::symlinked_component_is_refused_at_open.
Variants§
CrossProduct
The path is not beneath the project’s own .trusty-code/ directory.
Unpinned
A component was a symlink, or stopped being the directory the handle was opened on, at write time (#7779).
Fields
Unpinnable
The write target could not be pinned to a directory handle at all.
Fields
SymlinkEscape
A symlink on the path resolves outside .trusty-code/.
Trait Implementations§
Source§impl Debug for WriteTargetError
impl Debug for WriteTargetError
Source§impl Display for WriteTargetError
impl Display for WriteTargetError
impl Eq for WriteTargetError
Source§impl Error for WriteTargetError
impl Error for WriteTargetError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<WriteTargetError> for RosterDeployError
impl From<WriteTargetError> for RosterDeployError
Source§fn from(source: WriteTargetError) -> Self
fn from(source: WriteTargetError) -> Self
Source§impl PartialEq for WriteTargetError
impl PartialEq for WriteTargetError
impl StructuralPartialEq for WriteTargetError
Auto Trait Implementations§
impl Freeze for WriteTargetError
impl RefUnwindSafe for WriteTargetError
impl Send for WriteTargetError
impl Sync for WriteTargetError
impl Unpin for WriteTargetError
impl UnsafeUnpin for WriteTargetError
impl UnwindSafe for WriteTargetError
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<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 moreSource§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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more