Struct cairo_lang_parser::utils::SimpleParserDatabase
source · pub struct SimpleParserDatabase { /* private fields */ }
Expand description
A salsa database for parsing only.
Trait Implementations§
source§impl Database for SimpleParserDatabase
impl Database for SimpleParserDatabase
source§fn salsa_event(&self, event_fn: Event)
fn salsa_event(&self, event_fn: Event)
This function is invoked at key points in the salsa
runtime. It permits the database to be customized and to
inject logging or other custom behavior.
source§fn unwind_if_cancelled(&self)
fn unwind_if_cancelled(&self)
Starts unwinding the stack if the current revision is cancelled. Read more
source§fn salsa_runtime(&self) -> &Runtime
fn salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime. Read more
source§fn salsa_runtime_mut(&mut self) -> &mut Runtime
fn salsa_runtime_mut(&mut self) -> &mut Runtime
Gives access to the underlying salsa runtime. Read more
source§impl DatabaseOps for SimpleParserDatabase
impl DatabaseOps for SimpleParserDatabase
source§fn ops_database(&self) -> &dyn Database
fn ops_database(&self) -> &dyn Database
Upcast this type to a
dyn Database
.source§fn ops_salsa_runtime(&self) -> &Runtime
fn ops_salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime.
source§fn ops_salsa_runtime_mut(&mut self) -> &mut Runtime
fn ops_salsa_runtime_mut(&mut self) -> &mut Runtime
Gives access to the underlying salsa runtime.
source§fn fmt_index(&self, input: DatabaseKeyIndex, fmt: &mut Formatter<'_>) -> Result
fn fmt_index(&self, input: DatabaseKeyIndex, fmt: &mut Formatter<'_>) -> Result
Formats a database key index in a human readable fashion.
source§fn maybe_changed_since(
&self,
input: DatabaseKeyIndex,
revision: Revision
) -> bool
fn maybe_changed_since( &self, input: DatabaseKeyIndex, revision: Revision ) -> bool
True if the computed value for
input
may have changed since revision
.source§fn for_each_query(&self, op: &mut dyn FnMut(&dyn QueryStorageMassOps))
fn for_each_query(&self, op: &mut dyn FnMut(&dyn QueryStorageMassOps))
Executes the callback for each kind of query.
source§impl DatabaseStorageTypes for SimpleParserDatabase
impl DatabaseStorageTypes for SimpleParserDatabase
§type DatabaseStorage = __SalsaDatabaseStorage
type DatabaseStorage = __SalsaDatabaseStorage
Defines the “storage type”, where all the query data is kept.
This type is defined by the
database_storage
macro.source§impl Default for SimpleParserDatabase
impl Default for SimpleParserDatabase
source§impl HasQueryGroup<FilesDatabase> for SimpleParserDatabase
impl HasQueryGroup<FilesDatabase> for SimpleParserDatabase
source§fn group_storage(&self) -> &<FilesDatabase as QueryGroup>::GroupStorage
fn group_storage(&self) -> &<FilesDatabase as QueryGroup>::GroupStorage
Access the group storage struct from the database.
source§impl HasQueryGroup<ParserDatabase> for SimpleParserDatabase
impl HasQueryGroup<ParserDatabase> for SimpleParserDatabase
source§fn group_storage(&self) -> &<ParserDatabase as QueryGroup>::GroupStorage
fn group_storage(&self) -> &<ParserDatabase as QueryGroup>::GroupStorage
Access the group storage struct from the database.
source§impl HasQueryGroup<SyntaxDatabase> for SimpleParserDatabase
impl HasQueryGroup<SyntaxDatabase> for SimpleParserDatabase
source§fn group_storage(&self) -> &<SyntaxDatabase as QueryGroup>::GroupStorage
fn group_storage(&self) -> &<SyntaxDatabase as QueryGroup>::GroupStorage
Access the group storage struct from the database.
source§impl Upcast<dyn FilesGroup> for SimpleParserDatabase
impl Upcast<dyn FilesGroup> for SimpleParserDatabase
fn upcast(&self) -> &(dyn FilesGroup + 'static)
source§impl Upcast<dyn SyntaxGroup> for SimpleParserDatabase
impl Upcast<dyn SyntaxGroup> for SimpleParserDatabase
fn upcast(&self) -> &(dyn SyntaxGroup + 'static)
Auto Trait Implementations§
impl RefUnwindSafe for SimpleParserDatabase
impl Send for SimpleParserDatabase
impl !Sync for SimpleParserDatabase
impl Unpin for SimpleParserDatabase
impl UnwindSafe for SimpleParserDatabase
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<DB> FilesGroup for DBwhere
DB: Database + HasQueryGroup<FilesDatabase>,
impl<DB> FilesGroup for DBwhere DB: Database + HasQueryGroup<FilesDatabase>,
fn intern_crate(&self, crt: CrateLongId) -> CrateId
fn lookup_intern_crate(&self, key: CrateId) -> CrateLongId
fn intern_file(&self, file: FileLongId) -> FileId
fn lookup_intern_file(&self, key: FileId) -> FileLongId
fn intern_flag(&self, flag: FlagLongId) -> FlagId
fn lookup_intern_flag(&self, key: FlagId) -> FlagLongId
source§fn crate_roots(&self) -> Arc<OrderedHashMap<CrateId, Directory>>
fn crate_roots(&self) -> Arc<OrderedHashMap<CrateId, Directory>>
Main input of the project. Lists all the crates.
source§fn set_crate_roots(&mut self, value__: Arc<OrderedHashMap<CrateId, Directory>>)
fn set_crate_roots(&mut self, value__: Arc<OrderedHashMap<CrateId, Directory>>)
Set the value of the
crate_roots
input. Read moresource§fn set_crate_roots_with_durability(
&mut self,
value__: Arc<OrderedHashMap<CrateId, Directory>>,
durability__: Durability
)
fn set_crate_roots_with_durability( &mut self, value__: Arc<OrderedHashMap<CrateId, Directory>>, durability__: Durability )
Set the value of the
crate_roots
input and promise
that its value will never change again. Read moresource§fn file_overrides(&self) -> Arc<OrderedHashMap<FileId, Arc<String>>>
fn file_overrides(&self) -> Arc<OrderedHashMap<FileId, Arc<String>>>
Overrides for file content. Mostly used by language server and tests.
TODO(spapini): Currently, when this input changes, all the file_content() queries will
be invalidated.
Change this mechanism to hold file_overrides on the db struct outside salsa mechanism,
and invalidate manually.
source§fn set_file_overrides(
&mut self,
value__: Arc<OrderedHashMap<FileId, Arc<String>>>
)
fn set_file_overrides( &mut self, value__: Arc<OrderedHashMap<FileId, Arc<String>>> )
Set the value of the
file_overrides
input. Read moresource§fn set_file_overrides_with_durability(
&mut self,
value__: Arc<OrderedHashMap<FileId, Arc<String>>>,
durability__: Durability
)
fn set_file_overrides_with_durability( &mut self, value__: Arc<OrderedHashMap<FileId, Arc<String>>>, durability__: Durability )
Set the value of the
file_overrides
input and promise
that its value will never change again. Read moresource§fn set_flags(&mut self, value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>)
fn set_flags(&mut self, value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>)
Set the value of the
flags
input. Read moresource§fn set_flags_with_durability(
&mut self,
value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>,
durability__: Durability
)
fn set_flags_with_durability( &mut self, value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>, durability__: Durability )
Set the value of the
flags
input and promise
that its value will never change again. Read moresource§fn set_cfg_set_with_durability(
&mut self,
value__: Arc<CfgSet>,
durability__: Durability
)
fn set_cfg_set_with_durability( &mut self, value__: Arc<CfgSet>, durability__: Durability )
Set the value of the
cfg_set
input and promise
that its value will never change again. Read moresource§fn priv_raw_file_content(&self, file_id: FileId) -> Option<Arc<String>>
fn priv_raw_file_content(&self, file_id: FileId) -> Option<Arc<String>>
Query for raw file contents. Private.
source§fn file_content(&self, file_id: FileId) -> Option<Arc<String>>
fn file_content(&self, file_id: FileId) -> Option<Arc<String>>
Query for the file contents. This takes overrides into consideration.
fn file_summary(&self, file_id: FileId) -> Option<Arc<FileSummary>>
source§impl<DB> ParserGroup for DBwhere
DB: SyntaxGroup + Upcast<dyn SyntaxGroup> + FilesGroup + Database + HasQueryGroup<ParserDatabase>,
impl<DB> ParserGroup for DBwhere DB: SyntaxGroup + Upcast<dyn SyntaxGroup> + FilesGroup + Database + HasQueryGroup<ParserDatabase>,
source§fn priv_file_syntax_data(&self, file_id: FileId) -> SyntaxData
fn priv_file_syntax_data(&self, file_id: FileId) -> SyntaxData
Should only be used internally.
Parses a file and returns the result and the generated ParserDiagnostic.
source§fn file_syntax(
&self,
file_id: FileId
) -> Result<Arc<SyntaxFile>, DiagnosticAdded>
fn file_syntax( &self, file_id: FileId ) -> Result<Arc<SyntaxFile>, DiagnosticAdded>
Parses a file and returns its AST.
source§fn file_syntax_diagnostics(
&self,
file_id: FileId
) -> Diagnostics<ParserDiagnostic>
fn file_syntax_diagnostics( &self, file_id: FileId ) -> Diagnostics<ParserDiagnostic>
Returns the parser diagnostics for this file.