pub enum DecidingRule {
Folder {
folder_id: String,
depth: usize,
},
File {
file_id: String,
},
}Expand description
Which configured rule (if any) decided a Decision.
None — the Option wrapping this, not a variant here — means no rule
matched anywhere and the bare default policy decided it instead.
Carried into the request log’s decided_by_folder_id/
decided_by_file_id/decided_by_depth context fields so a refusal is
exactly as auditable as a success.
An enum rather than one struct with optional fields: a file rule has no depth (it names the target itself, at depth −1) and a folder rule has no file id, so “a file rule at depth 3” is a state that should not be expressible at all.
Variants§
Folder
A folder_id rule matched the target’s ancestor chain.
Fields
File
A file_id rule named the target itself.
Implementations§
Source§impl DecidingRule
impl DecidingRule
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
The id this rule keys on — a file id or a folder id.
Deliberately not rendered here: the id is operator-supplied but
the strings it sits beside are not, and this module stays free of
the CLI layer. Every render site must therefore sanitize before the
line reaches a terminal — the three CLI sites (drive edit,
upload, create) run the id through sanitize_for_terminal
directly; the two engine-layer describe functions (sheets write,
sheets create) embed it raw and their CLI callers sanitize the
whole rendered line instead.
Sourcepub const fn kind_label(&self) -> &'static str
pub const fn kind_label(&self) -> &'static str
"folder" or "file" — the noun the operator-facing messages use.
Sourcepub fn depth_suffix(&self) -> String
pub fn depth_suffix(&self) -> String
" (depth 2)" for a folder rule, "" for a file rule.
Exists so the five describe/print_report sites are one identical
line — "refused by rule on {kind} {id}{suffix}" — and cannot drift
into disagreeing about how a file rule is worded.
Trait Implementations§
Source§impl Clone for DecidingRule
impl Clone for DecidingRule
Source§impl Debug for DecidingRule
impl Debug for DecidingRule
impl Eq for DecidingRule
Source§impl PartialEq for DecidingRule
impl PartialEq for DecidingRule
Source§impl Serialize for DecidingRule
impl Serialize for DecidingRule
impl StructuralPartialEq for DecidingRule
Auto Trait Implementations§
impl Freeze for DecidingRule
impl RefUnwindSafe for DecidingRule
impl Send for DecidingRule
impl Sync for DecidingRule
impl Unpin for DecidingRule
impl UnsafeUnpin for DecidingRule
impl UnwindSafe for DecidingRule
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> 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
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> ⓘ
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