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§
Sourcefn ids(&self, knowledge: usize, id: &str) -> Vec<RepoPath>
fn ids(&self, knowledge: usize, id: &str) -> Vec<RepoPath>
ids returns the paths of the documents of knowledge that have
id.
Sourcefn ids_of_type(
&self,
knowledge: usize,
type_name: &str,
) -> Vec<(RepoPath, String)>
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.
Sourcefn is_document(&self, path: &RepoPath) -> bool
fn is_document(&self, path: &RepoPath) -> bool
is_document reports whether path is a document of any store.
Sourcefn fields(&self, path: &RepoPath) -> Option<Fields>
fn fields(&self, path: &RepoPath) -> Option<Fields>
fields returns the fields of the document at path.
Sourcefn broken(&self, path: &RepoPath) -> bool
fn broken(&self, path: &RepoPath) -> bool
broken reports whether the document at path has no frontmatter, or
has frontmatter that fails to parse.
Sourcefn broken_in(&self, knowledge: usize) -> Vec<RepoPath>
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.
Sourcefn schema_meta(&self, path: &RepoPath) -> Option<SchemaMeta>
fn schema_meta(&self, path: &RepoPath) -> Option<SchemaMeta>
schema_meta returns what the store keeps about the schema file at
path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".