coreon-core 0.1.0

Core abstractions for camel-rs: Exchange, Processor, Endpoint, Component, CamelContext.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Component — factory that turns URIs into Endpoints.

use crate::{endpoint::Endpoint, error::Result, uri::CamelUri};
use async_trait::async_trait;
use std::sync::Arc;

#[async_trait]
pub trait Component: Send + Sync {
    /// The scheme this component handles (e.g. "direct", "log").
    fn scheme(&self) -> &str;

    /// Build (or look up) an endpoint from a parsed URI.
    async fn create_endpoint(&self, uri: &CamelUri) -> Result<Arc<dyn Endpoint>>;
}