pub struct CustomGeneratorRegistry { /* private fields */ }Expand description
自定义生成器注册表
Implementations§
Source§impl CustomGeneratorRegistry
impl CustomGeneratorRegistry
Sourcepub fn register<G>(&mut self, generator: G) -> Result<()>where
G: CustomGenerator + 'static,
pub fn register<G>(&mut self, generator: G) -> Result<()>where
G: CustomGenerator + 'static,
注册生成器
Sourcepub fn get(&self, name: &str) -> Option<&dyn CustomGenerator>
pub fn get(&self, name: &str) -> Option<&dyn CustomGenerator>
获取生成器
Sourcepub fn unregister(&mut self, name: &str) -> bool
pub fn unregister(&mut self, name: &str) -> bool
移除生成器
Sourcepub fn list_generators(&self) -> Vec<GeneratorInfo>
pub fn list_generators(&self) -> Vec<GeneratorInfo>
列出所有生成器
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CustomGeneratorRegistry
impl !RefUnwindSafe for CustomGeneratorRegistry
impl Send for CustomGeneratorRegistry
impl Sync for CustomGeneratorRegistry
impl Unpin for CustomGeneratorRegistry
impl !UnwindSafe for CustomGeneratorRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more