pub trait UriConfig: Sized {
// Required methods
fn scheme() -> &'static str;
fn from_uri(uri: &str) -> Result<Self, CamelError>;
fn from_components(parts: UriComponents) -> Result<Self, CamelError>;
// Provided method
fn validate(self) -> Result<Self, CamelError> { ... }
}Expand description
Trait for configuration types that can be parsed from Camel URIs.
This trait is typically implemented via the #[derive(UriConfig)] macro
from camel-endpoint-macros.
Required Methods§
Sourcefn scheme() -> &'static str
fn scheme() -> &'static str
Returns the URI scheme this config handles (e.g., “timer”, “http”).
Sourcefn from_uri(uri: &str) -> Result<Self, CamelError>
fn from_uri(uri: &str) -> Result<Self, CamelError>
Parse a URI string into this configuration.
Sourcefn from_components(parts: UriComponents) -> Result<Self, CamelError>
fn from_components(parts: UriComponents) -> Result<Self, CamelError>
Parse already-extracted URI components into this configuration.
Provided Methods§
Sourcefn validate(self) -> Result<Self, CamelError>
fn validate(self) -> Result<Self, CamelError>
Override to add validation logic after parsing.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".