Skip to main content

Ctor

Trait Ctor 

Source
pub trait Ctor {
    type Opt: Opt;
    type Config;
    type Error: Into<Error>;

    // Required methods
    fn cid(&self) -> &Cid;
    fn new_with(
        &mut self,
        config: Self::Config,
    ) -> Result<Self::Opt, Self::Error>;
}
Expand description

Create Opt with given Config.

Required Associated Types§

Required Methods§

Source

fn cid(&self) -> &Cid

Source

fn new_with(&mut self, config: Self::Config) -> Result<Self::Opt, Self::Error>

Trait Implementations§

Source§

impl<Opt: Opt, Config: Send + Sync, Err: Into<Error>> Ctor for Box<dyn Ctor<Opt = Opt, Config = Config, Error = Err> + Send + Sync>

Available on crate feature sync only.

Implement Ctor for Box<dyn Ctor>.

Source§

type Opt = Opt

Source§

type Config = Config

Source§

type Error = Err

Source§

fn cid(&self) -> &Cid

Source§

fn new_with(&mut self, config: Self::Config) -> Result<Self::Opt, Self::Error>

Source§

impl<Opt: Opt, Config: Send + Sync, Err: Into<Error>> Debug for Box<dyn Ctor<Opt = Opt, Config = Config, Error = Err> + Send + Sync>

Available on crate feature sync only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Opt: Opt, Config: Send + Sync, Err: Into<Error>> Ctor for Box<dyn Ctor<Opt = Opt, Config = Config, Error = Err> + Send + Sync>

Available on crate feature sync only.

Implement Ctor for Box<dyn Ctor>.

Source§

type Opt = Opt

Source§

type Config = Config

Source§

type Error = Err

Source§

fn cid(&self) -> &Cid

Source§

fn new_with(&mut self, config: Self::Config) -> Result<Self::Opt, Self::Error>

Implementors§

Source§

impl<O: Opt, C, E: Into<Error>> Ctor for Creator<O, C, E>

Source§

type Opt = O

Source§

type Config = C

Source§

type Error = E