pub struct FunctionNode(/* private fields */);Expand description
Salsa input representing a single global function.
inferred_return_type is the Pass-2-derived return type, populated
per-function by the priming sweep. It is committed to Salsa serially
after the parallel sweep returns (so worker db clones have dropped
and Storage::cancel_others sees strong-count==1). The buffer-and-
commit pattern lives in [InferredReturnTypes] and
MirDb::commit_inferred_return_types.
Invariant: every FQN known to the Salsa DB has exactly one FunctionNode
handle in MirDb::function_nodes. Removed functions are marked
active = false rather than dropped.
Implementations§
Source§impl FunctionNode
impl FunctionNode
pub fn ingredient(db: &dyn Database) -> &IngredientImpl<Self>
pub fn ingredient_mut( zalsa_mut: &mut Zalsa, ) -> (&mut IngredientImpl<Self>, &mut Runtime)
Source§impl FunctionNode
impl FunctionNode
pub fn new<Db_>( db: &Db_, fqn: Arc<str>, short_name: Arc<str>, active: bool, params: Arc<[FnParam]>, return_type: Option<Arc<Union>>, inferred_return_type: Option<Arc<Union>>, template_params: Arc<[TemplateParam]>, assertions: Arc<[Assertion]>, throws: Arc<[Arc<str>]>, deprecated: Option<Arc<str>>, is_pure: bool, location: Option<Location>, ) -> Self
pub fn builder( fqn: Arc<str>, short_name: Arc<str>, active: bool, params: Arc<[FnParam]>, return_type: Option<Arc<Union>>, inferred_return_type: Option<Arc<Union>>, template_params: Arc<[TemplateParam]>, assertions: Arc<[Assertion]>, throws: Arc<[Arc<str>]>, deprecated: Option<Arc<str>>, is_pure: bool, location: Option<Location>, ) -> <Self as HasBuilder>::Builder
pub fn fqn<'db, Db_>(self, db: &'db Db_) -> Arc<str> ⓘ
pub fn short_name<'db, Db_>(self, db: &'db Db_) -> Arc<str> ⓘ
pub fn active<'db, Db_>(self, db: &'db Db_) -> bool
pub fn params<'db, Db_>(self, db: &'db Db_) -> Arc<[FnParam]> ⓘ
pub fn return_type<'db, Db_>(self, db: &'db Db_) -> Option<Arc<Union>>
pub fn inferred_return_type<'db, Db_>(self, db: &'db Db_) -> Option<Arc<Union>>
pub fn template_params<'db, Db_>(self, db: &'db Db_) -> Arc<[TemplateParam]> ⓘ
pub fn assertions<'db, Db_>(self, db: &'db Db_) -> Arc<[Assertion]> ⓘ
pub fn throws<'db, Db_>(self, db: &'db Db_) -> Arc<[Arc<str>]> ⓘ
pub fn deprecated<'db, Db_>(self, db: &'db Db_) -> Option<Arc<str>>
pub fn is_pure<'db, Db_>(self, db: &'db Db_) -> bool
Sourcepub fn location<'db, Db_>(self, db: &'db Db_) -> Option<Location>
pub fn location<'db, Db_>(self, db: &'db Db_) -> Option<Location>
Source location of the declaration. None for functions registered
without a known origin (e.g. some legacy test fixtures).
pub fn set_fqn<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Arc<str>> + use<'db, Db_>
pub fn set_short_name<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Arc<str>> + use<'db, Db_>
pub fn set_active<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = bool> + use<'db, Db_>
pub fn set_params<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Arc<[FnParam]>> + use<'db, Db_>
pub fn set_return_type<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Option<Arc<Union>>> + use<'db, Db_>
pub fn set_inferred_return_type<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Option<Arc<Union>>> + use<'db, Db_>
pub fn set_template_params<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Arc<[TemplateParam]>> + use<'db, Db_>
pub fn set_assertions<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Arc<[Assertion]>> + use<'db, Db_>
pub fn set_throws<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Arc<[Arc<str>]>> + use<'db, Db_>
pub fn set_deprecated<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Option<Arc<str>>> + use<'db, Db_>
pub fn set_is_pure<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = bool> + use<'db, Db_>
pub fn set_location<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Option<Location>> + use<'db, Db_>
Sourcepub fn default_debug_fmt(this: Self, f: &mut Formatter<'_>) -> Resultwhere
for<'__trivial_bounds, '__trivial_bounds> Arc<str>: Debug,
for<'__trivial_bounds, '__trivial_bounds> bool: Debug,
for<'__trivial_bounds> Arc<[FnParam]>: Debug,
for<'__trivial_bounds, '__trivial_bounds> Option<Arc<Union>>: Debug,
for<'__trivial_bounds> Arc<[TemplateParam]>: Debug,
for<'__trivial_bounds> Arc<[Assertion]>: Debug,
for<'__trivial_bounds> Arc<[Arc<str>]>: Debug,
for<'__trivial_bounds> Option<Arc<str>>: Debug,
for<'__trivial_bounds> Option<Location>: Debug,
pub fn default_debug_fmt(this: Self, f: &mut Formatter<'_>) -> Resultwhere
for<'__trivial_bounds, '__trivial_bounds> Arc<str>: Debug,
for<'__trivial_bounds, '__trivial_bounds> bool: Debug,
for<'__trivial_bounds> Arc<[FnParam]>: Debug,
for<'__trivial_bounds, '__trivial_bounds> Option<Arc<Union>>: Debug,
for<'__trivial_bounds> Arc<[TemplateParam]>: Debug,
for<'__trivial_bounds> Arc<[Assertion]>: Debug,
for<'__trivial_bounds> Arc<[Arc<str>]>: Debug,
for<'__trivial_bounds> Option<Arc<str>>: Debug,
for<'__trivial_bounds> Option<Location>: Debug,
Default debug formatting for this struct (may be useful if you define your own Debug impl)
Trait Implementations§
Source§impl Clone for FunctionNode
impl Clone for FunctionNode
Source§fn clone(&self) -> FunctionNode
fn clone(&self) -> FunctionNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Configuration for FunctionNode
impl Configuration for FunctionNode
const LOCATION: Location
const DEBUG_NAME: &'static str = "FunctionNode"
const FIELD_DEBUG_NAMES: &'static [&'static str]
Source§type Struct = FunctionNode
type Struct = FunctionNode
Id)Source§type Fields = (Arc<str>, Arc<str>, bool, Arc<[FnParam]>, Option<Arc<Union>>, Option<Arc<Union>>, Arc<[TemplateParam]>, Arc<[Assertion]>, Arc<[Arc<str>]>, Option<Arc<str>>, bool, Option<Location>)
type Fields = (Arc<str>, Arc<str>, bool, Arc<[FnParam]>, Option<Arc<Union>>, Option<Arc<Union>>, Arc<[TemplateParam]>, Arc<[Assertion]>, Arc<[Arc<str>]>, Option<Arc<str>>, bool, Option<Location>)
type Revisions = [Revision; 12]
type Durabilities = [Durability; 12]
Source§fn serialize<S: Serializer>(
fields: &Self::Fields,
serializer: S,
) -> Result<S::Ok, S::Error>
fn serialize<S: Serializer>( fields: &Self::Fields, serializer: S, ) -> Result<S::Ok, S::Error>
serde. Read moreSource§fn deserialize<'de, D: Deserializer<'de>>(
deserializer: D,
) -> Result<Self::Fields, D::Error>
fn deserialize<'de, D: Deserializer<'de>>( deserializer: D, ) -> Result<Self::Fields, D::Error>
serde. Read moreSource§impl HasJar for FunctionNode
impl HasJar for FunctionNode
Source§impl Hash for FunctionNode
impl Hash for FunctionNode
Source§impl PartialEq for FunctionNode
impl PartialEq for FunctionNode
Source§fn eq(&self, other: &FunctionNode) -> bool
fn eq(&self, other: &FunctionNode) -> bool
self and other values to be equal, and is used by ==.Source§impl SalsaStructInDb for FunctionNode
impl SalsaStructInDb for FunctionNode
type MemoIngredientMap = MemoIngredientSingletonIndex
Source§fn lookup_ingredient_index(aux: &Zalsa) -> IngredientIndices
fn lookup_ingredient_index(aux: &Zalsa) -> IngredientIndices
Source§fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
Source§impl Update for FunctionNode
impl Update for FunctionNode
impl Copy for FunctionNode
impl Eq for FunctionNode
impl StructuralPartialEq for FunctionNode
Auto Trait Implementations§
impl Freeze for FunctionNode
impl RefUnwindSafe for FunctionNode
impl Send for FunctionNode
impl Sync for FunctionNode
impl Unpin for FunctionNode
impl UnsafeUnpin for FunctionNode
impl UnwindSafe for FunctionNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> HashEqLike<&T> for T
impl<T> HashEqLike<&T> for T
Source§impl<T> HashEqLike<Cow<'_, T>> for T
impl<T> HashEqLike<Cow<'_, T>> for T
Source§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more