Skip to main content

RootDatabase

Struct RootDatabase 

Source
pub struct RootDatabase { /* private fields */ }
Expand description

The concrete analyzer database — a salsa Storage plus the Files side table.

Implementations§

Source§

impl RootDatabase

Source

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.

Source

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.

Source

pub fn remove_file(&mut self, file: FileId)

Remove file’s entry from the side table.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> RootDatabase

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Database for RootDatabase

Source§

fn trigger_lru_eviction(&mut self)

Enforces current LRU limits, evicting entries if necessary. Read more
Source§

fn synthetic_write(&mut self, durability: Durability)

A “synthetic write” causes the system to act as though some input of durability durability has changed, triggering a new revision. This is mostly useful for profiling scenarios. Read more
Source§

fn trigger_cancellation(&mut self)

This method cancels all outstanding computations. If you invoke it while a snapshot exists, it will block until that snapshot is dropped – if that snapshot is owned by the current thread, this could trigger deadlock.
Source§

fn cancellation_token(&self) -> CancellationToken

Retrieves a CancellationToken for the current database handle.
Source§

fn report_untracked_read(&self)

Reports that the query depends on some state unknown to salsa. Read more
Source§

fn ingredient_debug_name( &self, ingredient_index: IngredientIndex, ) -> Cow<'_, str>

Return the “debug name” (i.e., the struct name, etc) for an “ingredient”, which are the fine-grained components we use to track data. This is intended for debugging and the contents of the returned string are not semver-guaranteed. Read more
Source§

fn unwind_if_revision_cancelled(&self)

Starts unwinding the stack if the current revision is cancelled. Read more
Source§

fn attach<R>(&self, op: impl FnOnce(&Self) -> R) -> R
where Self: Sized,

Execute op with the database in thread-local storage for debug print-outs.
Source§

impl Db for RootDatabase

Source§

fn file_text(&self, file: FileId) -> Option<FileText>

The text input for file, or None if no text has been set for it.
Source§

fn engine(&self) -> Option<&'static EngineApi>

The bundled engine model, or 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>

The project’s file set, or 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>

The project’s 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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RootDatabase

Source§

fn default() -> RootDatabase

Returns the “default value” for a type. Read more
Source§

impl HasStorage for RootDatabase

Source§

fn storage(&self) -> &Storage<Self>

Source§

fn storage_mut(&mut self) -> &mut Storage<Self>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T> Lookup<T> for T

Source§

fn into_owned(self) -> T

Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more