pub type ProviderDescription = ComponentDescription<ProviderComponent>;
Aliased Type§
struct ProviderDescription { /* private fields */ }
Implementations
Source§impl<T> ComponentDescription<T>where
T: ComponentMarker + Sized + 'static,
iter<ComponentDescription<T>>: IntoIterator<Item = &'static ComponentDescription<T>>,
impl<T> ComponentDescription<T>where
T: ComponentMarker + Sized + 'static,
iter<ComponentDescription<T>>: IntoIterator<Item = &'static ComponentDescription<T>>,
Sourcepub const fn new<C: GenerateConfig + Configurable + 'static>(
component_name: &'static str,
label: &'static str,
logical_name: &'static str,
description: &'static str,
) -> Self
pub const fn new<C: GenerateConfig + Configurable + 'static>( component_name: &'static str, label: &'static str, logical_name: &'static str, description: &'static str, ) -> Self
Creates a new ComponentDescription
.
This creates a component description for a component identified both by the given component
type T
and the component name. As such, if T
is SourceComponent
, and the name is
stdin
, you would say that the component is a “source called stdin
”.
The type parameter C
must be the component’s configuration type that implements
Configurable
and GenerateConfig
.
Sourcepub fn example(component_name: &str) -> Result<Value, ExampleError>
pub fn example(component_name: &str) -> Result<Value, ExampleError>
Generates an example configuration for the component with the given component name.
§Errors
If no component, identified by T
and the given name, is registered, or if there is an
error generating the example configuration, an error variant will be returned.
Sourcepub fn types() -> Vec<&'static str>
pub fn types() -> Vec<&'static str>
Gets a sorted list of all registered components of the given component type.
Sourcepub fn generate_schemas(
gen: &RefCell<SchemaGenerator>,
) -> Result<SchemaObject, GenerateError>
pub fn generate_schemas( gen: &RefCell<SchemaGenerator>, ) -> Result<SchemaObject, GenerateError>
Generate a schema object covering all the descriptions of this type.