Skip to main content

UrlResolver

Trait UrlResolver 

Source
pub trait UrlResolver:
    Send
    + Sync
    + Debug {
    // Required methods
    fn can_resolve(&self, input: &str) -> bool;
    fn resolve<'a>(
        &'a self,
        uri: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<ResolvedContent, ToolError>> + Send + 'a>>;
}
Expand description

URL resolver for internal protocol schemes. The composition root implements this, bridging to oxi_sdk::ports::InternalUrlRouter.

Required Methods§

Source

fn can_resolve(&self, input: &str) -> bool

Whether this resolver handles the given input URI.

Source

fn resolve<'a>( &'a self, uri: &'a str, ) -> Pin<Box<dyn Future<Output = Result<ResolvedContent, ToolError>> + Send + 'a>>

Resolve an internal URI to its content, asynchronously.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§