camel-endpoint
Endpoint parsing and URI handling for rust-camel
Overview
camel-endpoint provides URI parsing and endpoint abstraction for the rust-camel framework. It handles the parsing of endpoint URIs in the format scheme:path?param1=value1¶m2=value2 that Camel is known for.
This crate is used internally by components to parse their configuration from URI strings.
Features
- URI parsing with scheme, path, and query parameters
UriComponentsstruct for easy access to URI partsUriConfigderive macro for declarative, typed component configuration- Error handling for malformed URIs
Installation
Add to your Cargo.toml:
[]
= "0.2"
Usage
use ;
// Parse a Camel-style URI
let uri = "timer:tick?period=1000&delay=500";
let components = parse_uri.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Declarative Config with UriConfig
The #[derive(UriConfig)] macro generates typed config structs from URI query parameters:
use UriConfig;
// Parse directly from a URI
let config = from_uri.unwrap;
assert_eq!;
assert_eq!;
URI Format
Endpoints follow the standard Camel URI format:
scheme:path[?param1=value1¶m2=value2]
scheme: The component name (e.g.,timer,file,http)path: Component-specific path (e.g., timer name, file directory)params: Optional query parameters for configuration
Documentation
License
Apache-2.0
Contributing
Contributions are welcome! Please see the main repository for details.