Skip to main content

Nidus

Struct Nidus 

Source
pub struct Nidus;
Expand description

Framework bootstrap entrypoint.

Implementations§

Source§

impl Nidus

Source

pub fn bootstrap<M: Module>() -> Result<Application>

Bootstraps a Nidus application from a root module definition.

The module graph is validated and the container is populated with the root module graph’s typed providers. Synchronous providers are registered here; providers that require async initialization are not run by this synchronous entrypoint and need Nidus::bootstrap_with_lifecycle (or the facade builder) to construct.

Source

pub fn bootstrap_with_modules<M, I>(modules: I) -> Result<Application>
where M: Module, I: IntoIterator<Item = ModuleDefinition>,

Bootstraps a Nidus application from a root module and explicit graph definitions.

Like Nidus::bootstrap, this validates the graph and registers synchronous typed providers. Async provider initializers are not run by this synchronous entrypoint.

Source

pub async fn bootstrap_with_lifecycle<M: Module>( lifecycle: LifecycleRunner, ) -> Result<Application>

Bootstraps a Nidus application and runs startup lifecycle hooks.

Typed providers are registered and async provider initializers run before startup hooks, so hooks can resolve fully initialized providers.

Source

pub async fn bootstrap_with_modules_and_lifecycle<M, I>( modules: I, lifecycle: LifecycleRunner, ) -> Result<Application>
where M: Module, I: IntoIterator<Item = ModuleDefinition>,

Bootstraps a Nidus application from an explicit module graph and runs startup hooks.

Typed providers are registered and async provider initializers run before startup hooks, so hooks can resolve fully initialized providers.

Auto Trait Implementations§

§

impl Freeze for Nidus

§

impl RefUnwindSafe for Nidus

§

impl Send for Nidus

§

impl Sync for Nidus

§

impl Unpin for Nidus

§

impl UnsafeUnpin for Nidus

§

impl UnwindSafe for Nidus

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Provider for T
where T: Send + Sync + 'static,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more