pub struct CamelContext { /* private fields */ }Expand description
Shared state handed to components/endpoints so they can resolve other
endpoints (e.g. a Producer sending into direct:next).
Implementations§
Source§impl CamelContext
impl CamelContext
pub fn new() -> Arc<Self>
pub fn register_component(&self, component: Arc<dyn Component>)
Sourcepub async fn resolve_endpoint(&self, uri_str: &str) -> Result<Arc<dyn Endpoint>>
pub async fn resolve_endpoint(&self, uri_str: &str) -> Result<Arc<dyn Endpoint>>
Resolve a URI to an Endpoint, reusing any previously-created endpoint
for the same URI. Creating an endpoint is cheap in MVP components, but
the cache is the natural place to deduplicate direct:foo producers
and consumers so they share the same channel.
Sourcepub async fn add_route(&self, route: Route)
pub async fn add_route(&self, route: Route)
Add a pre-built Route to the context. start() is what actually wires
consumers up.
pub async fn start(&self) -> Result<()>
pub async fn stop(&self) -> Result<()>
pub fn is_running(&self) -> bool
Auto Trait Implementations§
impl !Freeze for CamelContext
impl !RefUnwindSafe for CamelContext
impl Send for CamelContext
impl Sync for CamelContext
impl Unpin for CamelContext
impl UnsafeUnpin for CamelContext
impl !UnwindSafe for CamelContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more