Skip to main content

Fallback

Trait Fallback 

Source
pub trait Fallback: Debug {
    // Required methods
    fn ids(&self, knowledge: usize, id: &str) -> Vec<RepoPath>;
    fn ids_of_type(
        &self,
        knowledge: usize,
        type_name: &str,
    ) -> Vec<(RepoPath, String)>;
    fn is_document(&self, path: &RepoPath) -> bool;
    fn fields(&self, path: &RepoPath) -> Option<Fields>;
    fn broken(&self, path: &RepoPath) -> bool;
    fn broken_in(&self, knowledge: usize) -> Vec<RepoPath>;
    fn schema_meta(&self, path: &RepoPath) -> Option<SchemaMeta>;
    fn scalars_of_type(
        &self,
        knowledge: usize,
        type_name: &str,
    ) -> Vec<(RepoPath, Vec<(String, String)>)>;
}
Expand description

Fallback answers questions about the documents that the run doesn’t hold, from the store’s rows. A model queries it after searching its own documents, and never for a path that the model holds.

Required Methods§

Source

fn ids(&self, knowledge: usize, id: &str) -> Vec<RepoPath>

ids returns the paths of the documents of knowledge that have id.

Source

fn ids_of_type( &self, knowledge: usize, type_name: &str, ) -> Vec<(RepoPath, String)>

ids_of_type returns the path and id of each document of knowledge whose type is type_name.

Source

fn is_document(&self, path: &RepoPath) -> bool

is_document reports whether path is a document of any store.

Source

fn fields(&self, path: &RepoPath) -> Option<Fields>

fields returns the fields of the document at path.

Source

fn broken(&self, path: &RepoPath) -> bool

broken reports whether the document at path has no frontmatter, or has frontmatter that fails to parse.

Source

fn broken_in(&self, knowledge: usize) -> Vec<RepoPath>

broken_in returns the paths of the documents of knowledge whose frontmatter is missing or fails to parse.

Source

fn schema_meta(&self, path: &RepoPath) -> Option<SchemaMeta>

schema_meta returns what the store keeps about the schema file at path.

Source

fn scalars_of_type( &self, knowledge: usize, type_name: &str, ) -> Vec<(RepoPath, Vec<(String, String)>)>

scalars_of_type returns the path and the scalar frontmatter values of each document of knowledge whose type is type_name.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§