pub struct FileTargetDecision {
pub decision: Decision,
pub resolved_folder_id: Option<String>,
pub source: DecisionSource,
pub requires_lease: bool,
}Expand description
The full evaluation of a file target.
Fields§
§decision: DecisionThe verdict, and the rule that decided it.
resolved_folder_id: Option<String>The single folder the chain resolved through, when the target had
exactly one parent. Always None for FileRule and
NoVisibleParents, neither of which walks a chain.
source: DecisionSourceHow the verdict was reached.
requires_lease: boolWhether a write acting on decision needs a valid Drive write lease
(write_gate::decided_rule_requires_lease, ADR-0080 §1/§13).
Computed here, not by re-deriving it from decision.decided_by
after the fact: for a legacy multi-parent target,
write_gate::combine_across_parents keeps only the winning
parent’s decided_by, discarding every other parent’s — including
one whose rule required a lease. Re-querying
decided_rule_requires_lease against the single surviving
decided_by would silently drop that requirement whenever the
winning parent’s own rule happened to opt out. This field is instead
the OR of each contributing parent’s own requirement, computed
before its decided_by is folded away — see
[resolve_decision_for_parents].
Meaningless on its own for an operation that can never take a
lease in the first place (Read/Create/Upload/Trash —
DriveOperation::ever_requires_lease, issue #1917): this field
answers only “does a matching rule opt out”, never “can this
operation be asked at all”. The Trash engine ignores this field
under ADR-0092. drive permissions check, whose op is
caller-supplied, applies
ever_requires_lease on top of this field rather than trusting
it alone. A future caller that also accepts an arbitrary op
must do the same.
Trait Implementations§
Source§impl Clone for FileTargetDecision
impl Clone for FileTargetDecision
Auto Trait Implementations§
impl Freeze for FileTargetDecision
impl RefUnwindSafe for FileTargetDecision
impl Send for FileTargetDecision
impl Sync for FileTargetDecision
impl Unpin for FileTargetDecision
impl UnsafeUnpin for FileTargetDecision
impl UnwindSafe for FileTargetDecision
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<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