Trait TransientCtorFallible

Source
pub trait TransientCtorFallible<T>:
    Fn() -> Result<T, Box<dyn Error + Send + Sync>>
    + Send
    + Sync
    + 'static {
    // Required method
    fn call(self, _: SealToken) -> Result<T, Box<dyn Error + Send + Sync>>;
}
Expand description

Constructor closure for fallible transients.

This is a marker trait to identify all valid constructors usable by singletons. It’s not implementable by other crates.

A blanket implementation for Fn() -> Result<T, Err> is provided.

Required Methods§

Source

fn call(self, _: SealToken) -> Result<T, Box<dyn Error + Send + Sync>>

Calls the constructor.

Implementors§

Source§

impl<T, F> TransientCtorFallible<T> for F
where T: 'static, F: Fn() -> Result<T, Box<dyn Error + Send + Sync>> + Send + Sync + 'static,