pub struct RootDatabase { /* private fields */ }Expand description
The concrete analyzer database — a salsa Storage plus the Files side table.
Implementations§
Source§impl RootDatabase
impl RootDatabase
Sourcepub fn set_file_text(
&mut self,
file: FileId,
text: &str,
durability: Durability,
)
pub fn set_file_text( &mut self, file: FileId, text: &str, durability: Durability, )
Create/update file’s text input (the single input-mutation primitive apply_change
drives). Clones the Arc-backed Files handle first so self is free to pass as the
&mut dyn Db the salsa setter needs.
Sourcepub fn set_file_path(&mut self, file: FileId, path: &str)
pub fn set_file_path(&mut self, file: FileId, path: &str)
Set file’s res:// path (the loader supplies it on add; M3 preload/extends resolve
through it). Guarded against no-op re-sets — see Files::set_file_path.
Sourcepub fn remove_file(&mut self, file: FileId)
pub fn remove_file(&mut self, file: FileId)
Remove file’s entry from the side table.
Sourcepub fn set_project_config(&mut self, text: &str)
pub fn set_project_config(&mut self, text: &str)
Set the project’s project.godot text (the loader supplies it on project open / when it
changes — M4 autoloads). No-op if unchanged: salsa bumps an input field’s revision on
every set even for an identical value, so a redundant push would needlessly invalidate the
autoload registry. Held at MEDIUM durability, so a .gd keystroke never touches it.
Sourcepub fn set_engine_api(&mut self, api: EngineApi)
pub fn set_engine_api(&mut self, api: EngineApi)
Install a runtime-loaded engine model (the wasm path: a fetched extension_api blob
decoded via EngineApi::from_bytes). Leaked to &'static (one per session, process
lifetime). Load-once before any query — the engine model is not a salsa input, so a later
set would not invalidate cached reads; first-wins (a redundant install is ignored, so the
leak happens at most once). Native builds normally never call this (they fall back to the
bundled blob); it is the seam the wasm/wasip1 binding uses.
Sourcepub fn sync_source_root(&mut self)
pub fn sync_source_root(&mut self)
Rebuild the project file-set input from the current side table. Call this from
apply_change only when a file was added or removed — never on a body edit — so the
MEDIUM-durability project input (and everything derived from it) stays stable across
keystrokes.
Trait Implementations§
Source§impl Clone for RootDatabase
impl Clone for RootDatabase
Source§fn clone(&self) -> RootDatabase
fn clone(&self) -> RootDatabase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Database for RootDatabase
impl Database for RootDatabase
Source§fn trigger_lru_eviction(&mut self)
fn trigger_lru_eviction(&mut self)
Source§fn synthetic_write(&mut self, durability: Durability)
fn synthetic_write(&mut self, durability: Durability)
durability has changed, triggering a new revision.
This is mostly useful for profiling scenarios. Read moreSource§fn trigger_cancellation(&mut self)
fn trigger_cancellation(&mut self)
Source§fn cancellation_token(&self) -> CancellationToken
fn cancellation_token(&self) -> CancellationToken
CancellationToken for the current database handle.Source§fn report_untracked_read(&self)
fn report_untracked_read(&self)
Source§fn ingredient_debug_name(
&self,
ingredient_index: IngredientIndex,
) -> Cow<'_, str>
fn ingredient_debug_name( &self, ingredient_index: IngredientIndex, ) -> Cow<'_, str>
Source§fn unwind_if_revision_cancelled(&self)
fn unwind_if_revision_cancelled(&self)
Source§impl Db for RootDatabase
impl Db for RootDatabase
Source§fn file_text(&self, file: FileId) -> Option<FileText>
fn file_text(&self, file: FileId) -> Option<FileText>
file, or None if no text has been set for it.Source§fn engine(&self) -> Option<&'static EngineApi>
fn engine(&self) -> Option<&'static EngineApi>
None on wasm32 (no embedded blob — the host wires the
fetched blob in via EngineApi::from_bytes in Phase 5).Source§fn source_root(&self) -> Option<SourceRoot>
fn source_root(&self) -> Option<SourceRoot>
None before any file has been applied. Project-wide queries
(the global class_name registry) take this as their salsa-tracked input.Source§fn project_config(&self) -> Option<ProjectConfig>
fn project_config(&self) -> Option<ProjectConfig>
project.godot config, or None in single-file mode. The autoload registry
(M4) takes this as its salsa-tracked input.Source§impl Debug for RootDatabase
impl Debug for RootDatabase
Source§impl Default for RootDatabase
impl Default for RootDatabase
Source§fn default() -> RootDatabase
fn default() -> RootDatabase
Auto Trait Implementations§
impl !Freeze for RootDatabase
impl !RefUnwindSafe for RootDatabase
impl !Sync for RootDatabase
impl !UnwindSafe for RootDatabase
impl Send for RootDatabase
impl Unpin for RootDatabase
impl UnsafeUnpin for RootDatabase
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.