Skip to main content

ContentResolver

Trait ContentResolver 

Source
pub trait ContentResolver {
    // Required method
    fn resolve(
        &self,
        request: ContentResolveRequest,
        policy: ContentResolutionPolicy,
    ) -> Result<ResolvedContent, ContentResolutionError>;

    // Provided method
    fn store_resolved_content(
        &self,
        content_ref: &ContentRef,
        _bytes: Vec<u8>,
    ) -> Result<(), ContentResolutionError> { ... }
}
Expand description

Port or behavior contract for content resolver. Implementors should preserve policy, redaction, idempotency, and replay expectations from the surrounding module. Implementations may perform side effects only as described by the trait methods.

Required Methods§

Source

fn resolve( &self, request: ContentResolveRequest, policy: ContentResolutionPolicy, ) -> Result<ResolvedContent, ContentResolutionError>

Resolves resolve through the configured ports::content boundary. Concrete implementations own any backing-store, filesystem, or network side effects.

Provided Methods§

Source

fn store_resolved_content( &self, content_ref: &ContentRef, _bytes: Vec<u8>, ) -> Result<(), ContentResolutionError>

Stores resolved content bytes and metadata in the content backing store. Implementations store the resolved content bytes and metadata in the content resolver backing store for later policy-checked lookup.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§