Skip to main content

Answers

Trait Answers 

Source
pub trait Answers {
    // Required methods
    fn tags(&self, url: &str) -> Option<Answer<Vec<Tag>>>;
    fn reference(&self, url: &str, name: &str) -> Option<Answer<String>>;
    fn tree(
        &self,
        url: &str,
        commit: &str,
        path: Option<&str>,
    ) -> Option<Answer<Rc<dyn TreeSource>>>;
    fn path(&self, request: &PathRequest<'_>) -> Answer<PathSource>;

    // Provided method
    fn take_read_error(&self) -> Option<String> { ... }
}
Expand description

Every lookup the resolver makes. A tree is read on demand and rooted at path (None is the whole repository); a lookup with no answer yet is an open need (Outcome::Needs).

Required Methods§

Source

fn tags(&self, url: &str) -> Option<Answer<Vec<Tag>>>

Source

fn reference(&self, url: &str, name: &str) -> Option<Answer<String>>

Source

fn tree( &self, url: &str, commit: &str, path: Option<&str>, ) -> Option<Answer<Rc<dyn TreeSource>>>

Source

fn path(&self, request: &PathRequest<'_>) -> Answer<PathSource>

Provided Methods§

Source

fn take_read_error(&self) -> Option<String>

The first error a tree met reading a file since the last call: a tree has no error type, so an answerer that can fail to read latches it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§