pub struct Entry { /* private fields */ }Expand description
A live entry in an crate::EntryTree.
Entry is a cheap handle (interior Arc); two handles refer to the same
entry exactly when Entry::ptr_eq says so. The loader attaches the
entry’s Fiber here and uses Entry::suspend to suppress write-back
while applying changes that originate from the config file itself.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn ptr_eq(left: &Entry, right: &Entry) -> bool
pub fn ptr_eq(left: &Entry, right: &Entry) -> bool
Whether both handles refer to the same entry.
Sourcepub fn options(&self) -> EntryOptions
pub fn options(&self) -> EntryOptions
A snapshot of the raw entry options (config templates unexpanded,
group always empty — children are live tree state).
Sourcepub fn resolved_config(&self) -> Result<Option<Node>>
pub fn resolved_config(&self) -> Result<Option<Node>>
The config with ${{ env.NAME }} templates expanded and every
!!js expression node evaluated, ready to be handed to a plugin
as cordis_rs::Value::new(node). An out-of-subset expression
(for example one referencing ctx.*) fails here.
Sourcepub fn parent(&self) -> Option<Entry>
pub fn parent(&self) -> Option<Entry>
The parent entry, or None for the tree root and detached entries.
Sourcepub fn is_group(&self) -> bool
pub fn is_group(&self) -> bool
Whether this entry currently has children (i.e. acts as a group).
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
The entry’s own disable slot, statically viewed: Disabled::Flag
yields the flag, an unevaluated expression does not disable. The
options snapshot (Entry::options) carries the raw slot for
write-back.
Scope: this looks at the entry’s own slot only, so it is not the
negation of is_enabled, which also cascades
through every ancestor.
Sourcepub fn resolved_disabled(&self) -> Result<bool>
pub fn resolved_disabled(&self) -> Result<bool>
The entry’s own disable state with its !!js expression evaluated:
the expression must evaluate to a boolean, or the error propagates.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether this entry and every ancestor are statically enabled. A
disabled group cascades to its whole subtree. !!js expressions
are not evaluated here — an unevaluated expression does not
disable; use Entry::resolved_enabled for the evaluated
decision. Unlike is_disabled, this walks the
whole ancestor chain, so the two predicates are not complements.
Sourcepub fn resolved_enabled(&self) -> Result<bool>
pub fn resolved_enabled(&self) -> Result<bool>
Whether this entry and every ancestor are enabled once their
!!js expressions are evaluated (a disabled group cascades to
its whole subtree). The first evaluation failure propagates.
Sourcepub fn fiber(&self) -> Option<Fiber>
pub fn fiber(&self) -> Option<Fiber>
The fiber started for this entry, if any (set by the loader layer).
Sourcepub fn suspend(&self) -> EntrySuspendGuard
pub fn suspend(&self) -> EntrySuspendGuard
Increment the suspend counter, returning a guard. While suspended, the loader suppresses config write-back for this entry.
Sourcepub fn is_suspended(&self) -> bool
pub fn is_suspended(&self) -> bool
Whether any suspend guard is currently held for this entry.