Skip to main content

EntryOptions

Struct EntryOptions 

Source
pub struct EntryOptions {
    pub id: Option<String>,
    pub name: String,
    pub disabled: Disabled,
    pub inject: Vec<String>,
    pub group: Vec<EntryOptions>,
    pub config: Option<Node>,
}
Expand description

One entry in a config file: a plugin instance plus its group position.

The declared field order is the serialization order (id and name first, config last), keeping files readable and diff-stable. Entries with a group array are groups; the array order is the child order.

config is stored raw: ${{ env.NAME }} templates stay intact in the entry tree and are only expanded when the config is handed to a plugin (see crate::Entry::resolved_config).

Fields§

§id: Option<String>

Stable identity of the entry. Missing ids are filled with a random 6-character base36 id when the entry enters a tree and persisted on the next write-back.

§name: String

Plugin name used to resolve the plugin implementation.

§disabled: Disabled

Whether the entry (and transitively its subtree) is disabled: a static flag, or a !!js expression evaluated at activation whose raw text round-trips through the file.

§inject: Vec<String>

Names of services that must be active before this entry starts.

§group: Vec<EntryOptions>

Child entries, in order. Non-empty only for group entries.

§config: Option<Node>

Raw plugin configuration (templates unexpanded).

Implementations§

Source§

impl EntryOptions

Source

pub fn new(name: impl Into<String>) -> EntryOptions

Create options for a plugin with the given name.

Source

pub fn with_id(self, id: impl Into<String>) -> EntryOptions

Set the explicit entry id.

Source

pub fn with_config(self, config: Node) -> EntryOptions

Set the raw plugin configuration.

Source

pub fn with_group(self, group: Vec<EntryOptions>) -> EntryOptions

Set the child entries (turning this entry into a group).

Source

pub fn with_disabled(self, disabled: bool) -> EntryOptions

Set the static disable flag (see EntryOptions::disabled; use the field directly for a !!js expression).

Source

pub fn import_url(&self) -> Option<&str>

The url this import entry mounts, when the entry is an import (name: import with a string config.url).

Source

pub fn with_inject<I, S>(self, inject: I) -> EntryOptions
where I: IntoIterator<Item = S>, S: Into<String>,

Declare services that must be active before this entry starts.

Trait Implementations§

Source§

impl Clone for EntryOptions

Source§

fn clone(&self) -> EntryOptions

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 EntryOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for EntryOptions

Source§

fn default() -> EntryOptions

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for EntryOptions

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<EntryOptions, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for EntryOptions

Source§

fn eq(&self, other: &EntryOptions) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for EntryOptions

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for EntryOptions

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.