camel-component 0.5.7

Component trait and registry for rust-camel
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use camel_api::CamelError;

use crate::endpoint::Endpoint;

/// A Component is a factory for Endpoints.
///
/// Each component handles a specific URI scheme (e.g. "timer", "log", "direct").
pub trait Component: Send + Sync {
    /// The URI scheme this component handles (e.g., "timer", "log").
    fn scheme(&self) -> &str;

    /// Create an endpoint from a URI string.
    fn create_endpoint(&self, uri: &str) -> Result<Box<dyn Endpoint>, CamelError>;
}