pub enum WorkspaceEditError {
WorkspaceNotInitialised {
path: PathBuf,
},
InvalidToml {
path: PathBuf,
message: String,
},
BeforePatternNotFound {
section: &'static str,
pattern: String,
},
CrossLinkConflict {
from: String,
message: String,
},
RuleExistsSchemasDiffer {
section: &'static str,
pattern: String,
stored: Vec<String>,
requested: Vec<String>,
},
Io {
path: PathBuf,
source: Error,
},
}Expand description
Errors returned by the writer.
The idempotency cases (RuleAlreadyExists, RuleNotFound,
CrossLinkAlreadyGranted, CrossLinkNotGranted) live on
WorkspaceEditWarning rather than here — re-grant / re-revoke /
re-add / re-remove return success-with-warning rather than refusing,
letting CLI scripts and MCP agents retry safely without
branching on prior state. CrossLinkConflict stays an error
because it’s a real semantic conflict (wildcard vs. specific
list), not an idempotency case.
Variants§
WorkspaceNotInitialised
.memstead/workspace.toml missing or unreadable. The workspace
must be initialised before the CLI can edit its config.
InvalidToml
Existing file failed to parse as TOML.
BeforePatternNotFound
add_create_rule with --before <p> where <p> isn’t an
existing pattern in the section.
CrossLinkConflict
grant_cross_link with * against an existing specific list,
or with a specific target against an existing *. Operators
pick a single shape per from-mem.
RuleExistsSchemasDiffer
add_create_rule called for a pattern that already exists but
with a different schema set. Refused rather than silently
no-op’d: changing a pattern’s schema pins is a security-relevant
policy change, so it must be explicit (revoke the rule, then
re-add with the new schemas) — never a silent success echoing a
change that did not land. The genuine no-op (identical schemas)
stays WorkspaceEditWarning::RuleAlreadyPresent.
Io
IO failure writing the file back.
Implementations§
Trait Implementations§
Source§impl Debug for WorkspaceEditError
impl Debug for WorkspaceEditError
Source§impl Display for WorkspaceEditError
impl Display for WorkspaceEditError
Source§impl Error for WorkspaceEditError
impl Error for WorkspaceEditError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for WorkspaceEditError
impl !UnwindSafe for WorkspaceEditError
impl Freeze for WorkspaceEditError
impl Send for WorkspaceEditError
impl Sync for WorkspaceEditError
impl Unpin for WorkspaceEditError
impl UnsafeUnpin for WorkspaceEditError
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for 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