Skip to main content

UriConfig

Trait UriConfig 

Source
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§

Source

fn scheme() -> &'static str

Returns the URI scheme this config handles (e.g., “timer”, “http”).

Source

fn from_uri(uri: &str) -> Result<Self, CamelError>

Parse a URI string into this configuration.

Source

fn from_components(parts: UriComponents) -> Result<Self, CamelError>

Parse already-extracted URI components into this configuration.

Provided Methods§

Source

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", so this trait is not object safe.

Implementors§