polywrap_core 0.1.11

Core types of Polywrap client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::sync::Arc;
use std::{fmt::Debug, sync::Mutex};

use super::uri_resolution_context::{UriPackageOrWrapper, UriResolutionContext};
use crate::error::Error;
use crate::invoker::Invoker;
use crate::uri::Uri;

/// Trait that defines a URI resolver
pub trait UriResolver: Send + Sync + Debug {
    fn try_resolve_uri(
        &self,
        uri: &Uri,
        client: Arc<dyn Invoker>,
        resolution_context: Arc<Mutex<UriResolutionContext>>,
    ) -> Result<UriPackageOrWrapper, Error>;
}