Skip to main content

ProtocolHandler

Trait ProtocolHandler 

Source
pub trait ProtocolHandler: Send + Sync {
    // Required methods
    fn scheme(&self) -> &str;
    fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        selector: Option<&'life2 str>,
        ctx: &'life3 ResolveContext,
    ) -> Pin<Box<dyn Future<Output = Result<ResolvedUrl, SdkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided method
    fn immutable(&self) -> bool { ... }
}
Expand description

Single-scheme handler contract. Products implement one per scheme (issue://, pr://, agent://, etc.) and register them with the router.

Required Methods§

Source

fn scheme(&self) -> &str

Lowercase scheme this handler serves (“issue”, “pr”, …).

Source

fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, url: &'life1 str, selector: Option<&'life2 str>, ctx: &'life3 ResolveContext, ) -> Pin<Box<dyn Future<Output = Result<ResolvedUrl, SdkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Resolve a URL path (scheme already stripped) to text content.

Provided Methods§

Source

fn immutable(&self) -> bool

When true, the resolved content is immutable (hashline anchor suppressed).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§