Skip to main content

Resolver

Trait Resolver 

Source
pub trait Resolver {
    // Required methods
    fn resolve(&mut self, path: &str) -> Result<String, String>;
    fn open(&mut self, identity: &str) -> Result<Box<dyn Read + Send>, String>;
}
Expand description

How a host gives a program its data. A program only names paths: what they refer to, and whether they may be read, is the host’s policy, and a program can’t widen it.

Required Methods§

Source

fn resolve(&mut self, path: &str) -> Result<String, String>

What path refers to, as written in the program (- is standard input): an identity, such as a full file name. Two inputs with the same identity read the same bytes. Or why it may not be read.

Source

fn open(&mut self, identity: &str) -> Result<Box<dyn Read + Send>, String>

Open the data with this identity.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§