Struct miau::builder::AsyncConfigurationBuilder [−][src]
Configuration builder capable of using both synchronous and asynchronous sources.
This power comes at a price - it requires executor. Therefore it can only be invoked inside runtime.
Owns all sources passed to it and is capable of creating Configuration object.
Since it handles both synchronous and asynchronous sources it is possible to create async builder with only synchronous sources. It is discouraged as in such case execution is the same as in case of synchronous builder, but requires runtime.
Implementations
impl<'provider> AsyncConfigurationBuilder<'provider>
[src]
pub fn new() -> Self
[src]
Creates new builder.
This function is used in Default trait implementation.
use miau::builder::AsyncConfigurationBuilder; let builder = AsyncConfigurationBuilder::new();
pub fn from_synchronous_builder(
builder: ConfigurationBuilder<'provider>
) -> AsyncConfigurationBuilder<'provider>
[src]
builder: ConfigurationBuilder<'provider>
) -> AsyncConfigurationBuilder<'provider>
Creates asynchronous builder from synchronous one, consuming it.
It should not be used directly. Instead either use async builder from the start or use one of methods of synchronous builder that convert it for you.
Exposed as public API to serve strangest needs.
pub fn add<S, D>(
&mut self,
source: S,
format: D
) -> &mut AsyncConfigurationBuilder<'provider> where
S: Source + 'provider,
D: Format + 'provider,
[src]
&mut self,
source: S,
format: D
) -> &mut AsyncConfigurationBuilder<'provider> where
S: Source + 'provider,
D: Format + 'provider,
Adds new synchronous source and format to builder.
Similar to add
on synchronous builder.
pub fn add_provider<P>(
&mut self,
provider: P
) -> &mut AsyncConfigurationBuilder<'provider> where
P: Provider + 'provider,
[src]
&mut self,
provider: P
) -> &mut AsyncConfigurationBuilder<'provider> where
P: Provider + 'provider,
Adds new synchronous provider to builder.
Similar to add_provider
on synchronous builder.
pub fn add_async<S, D>(
&mut self,
source: S,
format: D
) -> &mut AsyncConfigurationBuilder<'provider> where
S: AsyncSource + Send + Sync + 'provider,
D: Format + Send + Sync + 'provider,
[src]
&mut self,
source: S,
format: D
) -> &mut AsyncConfigurationBuilder<'provider> where
S: AsyncSource + Send + Sync + 'provider,
D: Format + Send + Sync + 'provider,
Adds new asynchronous source and format to builder.
Similar to add_async
on synchronous builder.
Unlike it, however, it is not consuming the builder.
pub fn add_provider_async<P>(
&mut self,
provider: P
) -> &mut AsyncConfigurationBuilder<'provider> where
P: AsyncProvider + 'provider,
[src]
&mut self,
provider: P
) -> &mut AsyncConfigurationBuilder<'provider> where
P: AsyncProvider + 'provider,
Adds new asynchronous provider to builder.
Similar to add_provider_async
on synchronous builder.
Unlike it, however, it is not consuming the builder.
pub async fn build(&mut self) -> Result<Configuration, ConfigurationError>
[src]
Builds the builder.
This is function that actually fetches data from all the sources and deserializes them.
Since it is asynchronous, it requires runtime to be present.
Trait Implementations
impl<'provider> Default for AsyncConfigurationBuilder<'provider>
[src]
Auto Trait Implementations
impl<'provider> !RefUnwindSafe for AsyncConfigurationBuilder<'provider>
[src]
impl<'provider> !Send for AsyncConfigurationBuilder<'provider>
[src]
impl<'provider> !Sync for AsyncConfigurationBuilder<'provider>
[src]
impl<'provider> Unpin for AsyncConfigurationBuilder<'provider>
[src]
impl<'provider> !UnwindSafe for AsyncConfigurationBuilder<'provider>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,