Skip to main content

Factory

Trait Factory 

Source
pub trait Factory<T: ?Sized> {
    // Required method
    fn create(&self) -> Box<T>;
}
Expand description

用于创建类型 T 实例的工厂 trait。

实现此 trait 的类型可以创建目标类型的装箱实例。 类型 T 必须是 Send + Sync 并且可以是非固定大小类型。

Required Methods§

Source

fn create(&self) -> Box<T>

Implementors§