Skip to main content

DbLoader

Struct DbLoader 

Source
pub struct DbLoader<L: ConfigLoader>(pub L);
Expand description

A Loader that delegates to a ConfigLoader implementation.

Wraps any ConfigLoader and adapts it to the Loader trait, routing identifiers by URL scheme and returning parsed configuration data.

Tuple Fields§

§0: L

Implementations§

Source§

impl<L: ConfigLoader> DbLoader<L>

Source

pub const fn new(loader: L) -> Self

Trait Implementations§

Source§

impl<L: ConfigLoader> Loader for DbLoader<L>

Source§

fn provides(&self, identifier: &str) -> bool

Whether this loader can handle the given identifier. Read more
Source§

fn load<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, identifier: &'life1 str, formatters: &'life2 [&'life3 dyn Formatter], ) -> Pin<Box<dyn Future<Output = Result<LoadResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Load and parse configuration from the identifier. Read more
Source§

fn name(&self) -> &str

Human-readable name for error messages.
Source§

fn watch<'life0, 'life1, 'async_trait>( &'life0 self, _identifier: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Config>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Watch the identified source for changes. Read more

Auto Trait Implementations§

§

impl<L> Forget for DbLoader<L>

§

impl<L> Freeze for DbLoader<L>
where L: Freeze,

§

impl<L> RefUnwindSafe for DbLoader<L>
where L: RefUnwindSafe,

§

impl<L> Send for DbLoader<L>

§

impl<L> Sync for DbLoader<L>

§

impl<L> Unpin for DbLoader<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for DbLoader<L>
where L: UnsafeUnpin,

§

impl<L> UnwindSafe for DbLoader<L>
where L: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.