Skip to main content

MirDb

Struct MirDb 

Source
pub struct MirDb { /* private fields */ }

Implementations§

Source§

impl MirDb

Source

pub fn remove_file_definitions(&mut self, file: &str)

Source

pub fn type_count(&self) -> usize

Source

pub fn function_count(&self) -> usize

Source

pub fn constant_count(&self) -> usize

Source

pub fn ingest_stub_slice(&mut self, slice: &StubSlice)

Walk one collected StubSlice and upsert the corresponding db nodes.

This is the canonical post-Pass-1 ingestion path: each file’s slice is fed in directly, so batch analysis does not need any intermediate mutable codebase store between Pass 1 and Pass 2.

Source

pub fn upsert_class_node(&mut self, fields: ClassNodeFields) -> ClassNode

Create or update the ClassNode for fqcn.

If a handle already exists, its fields are updated in-place so Salsa can track the change. A new handle is created only on first registration.

Source

pub fn deactivate_class_node(&mut self, fqcn: &str)

Mark the ClassNode for fqcn as inactive.

Dependent class_ancestors queries will observe the change and re-run, returning an empty list.

Source

pub fn upsert_function_node( &mut self, storage: &FunctionStorage, ) -> FunctionNode

Create or update the FunctionNode for the given FunctionStorage.

Source

pub fn commit_inferred_return_types(&mut self, buf: &InferredReturnTypes)

Commit a parallel-sweep-collected InferredReturnTypes buffer into the Salsa db. Must be called serially, after all rayon workers from the priming sweep have dropped their db clones, so that Storage::cancel_others sees strong-count==1 inside the setter. Calling this from inside a for_each_with / map_with closure will deadlock.

Skips writes whose value already matches the current Salsa-tracked value (preserves PR21’s fast-skip semantics). Skips inactive nodes — there’s no point committing an inferred return for a node that has been deactivated by a re-analyze.

Source

pub fn deactivate_function_node(&mut self, fqn: &str)

Mark the FunctionNode for fqn as inactive.

Source

pub fn upsert_method_node(&mut self, storage: &MethodStorage) -> MethodNode

Create or update the MethodNode for (storage.fqcn, storage.name.to_lowercase()).

Source

pub fn deactivate_class_methods(&mut self, fqcn: &str)

Mark all MethodNodes owned by fqcn as inactive.

Source

pub fn prune_class_methods<T>(&mut self, fqcn: &str, keep_lower: &HashSet<T>)
where T: Eq + Hash + Borrow<str>,

Deactivate MethodNodes for fqcn whose lowercased name is not in keep_lower. Used by ingest_stub_slice to prune stale stub methods when a user file shadows a bundled-stub class with a different method set. Active-only check preserves PR21’s fast-skip — already-inactive nodes don’t fire a setter.

Source

pub fn prune_class_properties<T>(&mut self, fqcn: &str, keep: &HashSet<T>)
where T: Eq + Hash + Borrow<str>,

Deactivate PropertyNodes for fqcn whose name is not in keep.

Source

pub fn prune_class_constants<T>(&mut self, fqcn: &str, keep: &HashSet<T>)
where T: Eq + Hash + Borrow<str>,

Deactivate ClassConstantNodes for fqcn whose name is not in keep.

Source

pub fn upsert_property_node( &mut self, fqcn: &Arc<str>, storage: &PropertyStorage, )

Create or update the PropertyNode for (storage.fqcn, storage.name).

Source

pub fn deactivate_class_properties(&mut self, fqcn: &str)

Mark all PropertyNodes owned by fqcn as inactive.

Source

pub fn upsert_class_constant_node( &mut self, fqcn: &Arc<str>, storage: &ConstantStorage, )

Create or update the ClassConstantNode for (fqcn, storage.name).

Source

pub fn upsert_global_constant_node( &mut self, fqn: Arc<str>, ty: Union, ) -> GlobalConstantNode

Create or update the GlobalConstantNode for fqn.

Source

pub fn deactivate_global_constant_node(&mut self, fqn: &str)

Mark the GlobalConstantNode for fqn as inactive.

Source

pub fn deactivate_class_constants(&mut self, fqcn: &str)

Mark all ClassConstantNodes owned by fqcn as inactive.

Trait Implementations§

Source§

impl Clone for MirDb

Source§

fn clone(&self) -> MirDb

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Database for MirDb

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 Default for MirDb

Source§

fn default() -> MirDb

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

impl HasStorage for MirDb

Source§

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

Source§

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

Source§

impl MirDatabase for MirDb

Source§

fn php_version_str(&self) -> Arc<str>

The PHP version configured for this analysis run.
Source§

fn lookup_class_node(&self, fqcn: &str) -> Option<ClassNode>

Look up the ClassNode handle registered for fqcn, if any. Read more
Source§

fn lookup_function_node(&self, fqn: &str) -> Option<FunctionNode>

Look up the FunctionNode handle registered for fqn, if any.
Source§

fn lookup_method_node( &self, fqcn: &str, method_name_lower: &str, ) -> Option<MethodNode>

Look up the MethodNode for (fqcn, method_name_lower), if any. Read more
Source§

fn lookup_property_node( &self, fqcn: &str, prop_name: &str, ) -> Option<PropertyNode>

Look up the PropertyNode for (fqcn, prop_name), if any.
Source§

fn lookup_class_constant_node( &self, fqcn: &str, const_name: &str, ) -> Option<ClassConstantNode>

Look up the ClassConstantNode for (fqcn, const_name), if any.
Source§

fn lookup_global_constant_node(&self, fqn: &str) -> Option<GlobalConstantNode>

Look up the GlobalConstantNode for fqn, if any.
Source§

fn class_own_methods(&self, fqcn: &str) -> Vec<MethodNode>

Return all own-method nodes for fqcn. Empty if no class is registered. Untracked iteration of a per-class HashMap.
Source§

fn class_own_properties(&self, fqcn: &str) -> Vec<PropertyNode>

Return all own-property nodes for fqcn. Empty if no class is registered. Untracked iteration of a per-class HashMap.
Source§

fn active_class_node_fqcns(&self) -> Vec<Arc<str>>

Return all class-FQCNs currently registered as active ClassNodes, optionally filtered by kind. Untracked snapshot — callers should treat the returned Vec as a one-shot view.
Source§

fn active_function_node_fqns(&self) -> Vec<Arc<str>>

Return all function-FQNs currently registered as active FunctionNodes. Untracked snapshot.
Source§

fn file_namespace(&self, file: &str) -> Option<Arc<str>>

Return this file’s first declared namespace, if any.
Source§

fn file_imports(&self, file: &str) -> HashMap<String, String>

Return this file’s use alias map.
Source§

fn global_var_type(&self, name: &str) -> Option<Union>

Return the known type for a PHP global variable.
Source§

fn file_import_snapshots(&self) -> Vec<(Arc<str>, HashMap<String, String>)>

Return (file, imports) snapshots for every known file.
Source§

fn symbol_defining_file(&self, symbol: &str) -> Option<Arc<str>>

Return the defining file for a symbol, if known.
Source§

fn symbols_defined_in_file(&self, file: &str) -> Vec<Arc<str>>

Return all symbols whose defining file is file.
Source§

fn record_reference_location(&self, loc: RefLoc)

Record a reference-location entry.
Source§

fn replay_reference_locations( &self, file: Arc<str>, locs: &[(String, u32, u16, u16)], )

Replay reference locations for one file from cache.
Source§

fn extract_file_reference_locations( &self, file: &str, ) -> Vec<(Arc<str>, u32, u16, u16)>

Extract reference locations for one file in cache-storage shape.
Source§

fn reference_locations(&self, symbol: &str) -> Vec<(Arc<str>, u32, u16, u16)>

Return all reference locations for one public symbol key.
Source§

fn has_reference(&self, symbol: &str) -> bool

Whether the public symbol key has at least one recorded reference.
Source§

fn clear_file_references(&self, file: &str)

Clear reference locations for a file before re-analysis.

Auto Trait Implementations§

§

impl !Freeze for MirDb

§

impl RefUnwindSafe for MirDb

§

impl Send for MirDb

§

impl !Sync for MirDb

§

impl Unpin for MirDb

§

impl UnsafeUnpin for MirDb

§

impl !UnwindSafe for MirDb

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Lookup<T> for T

Source§

fn into_owned(self) -> T

Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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