Skip to main content

AutoDefaultConfigProvider

Struct AutoDefaultConfigProvider 

Source
pub struct AutoDefaultConfigProvider<'p, A: Serialize, F: Fn() -> A> { /* private fields */ }
Expand description

Generates default configurations by combining two things:

  • general config options, provided by a function F
  • the default config of every plugin that is enabled in a PluginSet

§Config structure

The generated configuration follows what is expected by PluginSet::extract_config and other agent-related functions. Refer to the module documentation for more information.

Implementations§

Source§

impl<'p, A: Serialize, F: Fn() -> A> AutoDefaultConfigProvider<'p, A, F>

Source

pub fn new(plugins: &'p PluginSet, default_general_options: F) -> Self

Creates a new default config provider that use the given plugins and general options.

See the structure documentation for more details.

Trait Implementations§

Source§

impl<'p, A: Serialize, F: Fn() -> A> DefaultConfigProvider for AutoDefaultConfigProvider<'p, A, F>

Source§

fn default_config(&self) -> Result<Table>

Gets the default config as a structured TOML table.
Source§

fn default_config_string(&self) -> Result<String>

Gets the default config as a string. Read more

Auto Trait Implementations§

§

impl<'p, A, F> Freeze for AutoDefaultConfigProvider<'p, A, F>
where F: Freeze,

§

impl<'p, A, F> !RefUnwindSafe for AutoDefaultConfigProvider<'p, A, F>

§

impl<'p, A, F> !Send for AutoDefaultConfigProvider<'p, A, F>

§

impl<'p, A, F> !Sync for AutoDefaultConfigProvider<'p, A, F>

§

impl<'p, A, F> Unpin for AutoDefaultConfigProvider<'p, A, F>
where F: Unpin,

§

impl<'p, A, F> UnsafeUnpin for AutoDefaultConfigProvider<'p, A, F>
where F: UnsafeUnpin,

§

impl<'p, A, F> !UnwindSafe for AutoDefaultConfigProvider<'p, A, F>

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> 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, 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.