Skip to main content

camel_component/
component.rs

1use camel_api::CamelError;
2
3use crate::endpoint::Endpoint;
4
5/// A Component is a factory for Endpoints.
6///
7/// Each component handles a specific URI scheme (e.g. "timer", "log", "direct").
8pub trait Component: Send + Sync {
9    /// The URI scheme this component handles (e.g., "timer", "log").
10    fn scheme(&self) -> &str;
11
12    /// Create an endpoint from a URI string.
13    fn create_endpoint(&self, uri: &str) -> Result<Box<dyn Endpoint>, CamelError>;
14}