Skip to main content

Entry

Struct Entry 

Source
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

Source

pub fn id(&self) -> &str

Stable identity of this entry; never empty except for the root.

Source

pub fn ptr_eq(left: &Entry, right: &Entry) -> bool

Whether both handles refer to the same entry.

Source

pub fn name(&self) -> String

The plugin name from the entry options.

Source

pub fn options(&self) -> EntryOptions

A snapshot of the raw entry options (config templates unexpanded, group always empty — children are live tree state).

Source

pub fn config(&self) -> Option<Node>

The raw config with ${{ ... }} templates still intact.

Source

pub fn resolved_config(&self) -> Result<Option<Node>>

The config with ${{ env.NAME }} templates expanded, ready to be handed to a plugin as cordis_rs::Value::new(node).

Source

pub fn parent(&self) -> Option<Entry>

The parent entry, or None for the tree root and detached entries.

Source

pub fn children(&self) -> Vec<Entry>

Child entries in file order. Empty for leaf entries.

Source

pub fn is_group(&self) -> bool

Whether this entry currently has children (i.e. acts as a group).

Source

pub fn path(&self) -> String

Composite id from the tree root down to this entry, e.g. a1:b2.

Source

pub fn disabled(&self) -> bool

Whether this entry is itself flagged as disabled.

Source

pub fn enabled(&self) -> bool

Whether the entry and every ancestor are enabled. A disabled group cascades to its whole subtree.

Source

pub fn fiber(&self) -> Option<Fiber>

The fiber started for this entry, if any (set by the loader layer).

Source

pub fn set_fiber(&self, fiber: Option<Fiber>)

Attach or detach the entry’s fiber.

Source

pub fn suspend(&self) -> EntrySuspendGuard

Increment the suspend counter, returning a guard. While suspended, the loader suppresses config write-back for this entry.

Source

pub fn is_suspended(&self) -> bool

Whether any suspend guard is currently held for this entry.

Trait Implementations§

Source§

impl Clone for Entry

Source§

fn clone(&self) -> Entry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Entry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnsafeUnpin for Entry

§

impl UnwindSafe for Entry

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.