pub struct Protected { /* private fields */ }Expand description
The protected set, compiled once.
Implementations§
Source§impl Protected
impl Protected
Sourcepub fn new(rules: &'static Rules) -> Self
pub fn new(rules: &'static Rules) -> Self
The protected set of a project whose format has rules.
Sourcepub fn reason(&self, class: Class) -> &'static str
pub fn reason(&self, class: Class) -> &'static str
What the model is told about a write to a path of class.
Sourcepub fn is_review(&self, rel: &str) -> bool
pub fn is_review(&self, rel: &str) -> bool
Whether a normalised path is a review record: an intent path named
REVIEW_FILE. A planning skill writes intent; never this.
Sourcepub fn is_secret(&self, rel: &str) -> bool
pub fn is_secret(&self, rel: &str) -> bool
Whether a normalised path is a secret (refused for reading too).
Sourcepub fn write_class(&self, rel: &str) -> Option<Class>
pub fn write_class(&self, rel: &str) -> Option<Class>
The protected class a normalised path belongs to, for writing.
Sourcepub fn is_context(&self, rel: &str) -> bool
pub fn is_context(&self, rel: &str) -> bool
Whether a normalised path is an agent context file (AGENTS.md,
CLAUDE.md, GEMINI.md): writable only with a person’s approval.
Sourcepub fn is_judged(&self, rel: &str) -> bool
pub fn is_judged(&self, rel: &str) -> bool
Whether a normalised path is a judge or intent input: what a command must not change while an attempt runs.
Sourcepub fn is_design_doc(&self, rel: &str) -> bool
pub fn is_design_doc(&self, rel: &str) -> bool
Whether a normalised path is a design document of the intent: an intent path that is no judge input, agent context file, manifest, credential or hidden file — what a planning task may write.
Sourcepub fn is_manifest(&self, rel: &str) -> bool
pub fn is_manifest(&self, rel: &str) -> bool
Whether writing this path changes dependencies (needs approval).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Protected
impl Freeze for Protected
impl RefUnwindSafe for Protected
impl Send for Protected
impl Sync for Protected
impl Unpin for Protected
impl UnsafeUnpin for Protected
impl UnwindSafe for Protected
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,
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