Skip to main content

ProviderRegistration

Trait ProviderRegistration 

Source
pub trait ProviderRegistration:
    Send
    + Sync
    + 'static {
    // Required methods
    fn source_type(&self) -> &'static str;
    fn factory(&self) -> ProviderFactory;
}
Expand description

Trait implemented by each registered provider’s registration hook.

The indirection exists so RELEASE_PROVIDERS can be a slice of fn() -> Box<dyn ProviderRegistration> — matching the rtb_app::BUILTIN_COMMANDS convention (fn() -> Box<dyn Command>). Struct-valued distributed slices trip the link_section lint under crate-level #![forbid(unsafe_code)] on Rust 1.95+; boxed trait objects don’t.

Required Methods§

Source

fn source_type(&self) -> &'static str

The discriminator (github, gitlab, custom, …) the factory was registered under.

Source

fn factory(&self) -> ProviderFactory

The factory that constructs a provider for this backend.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§