Struct salsa_2022::input::InputIngredient
source · [−]pub struct InputIngredient<Id>where
Id: InputId,{ /* private fields */ }
Implementations
sourceimpl<Id> InputIngredient<Id>where
Id: InputId,
impl<Id> InputIngredient<Id>where
Id: InputId,
pub fn new(index: IngredientIndex, debug_name: &'static str) -> Self
pub fn database_key_index(&self, id: Id) -> DatabaseKeyIndex
pub fn new_input(&self, _runtime: &Runtime) -> Id
pub fn new_singleton_input(&self, _runtime: &Runtime) -> Id
pub fn get_singleton_input(&self, _runtime: &Runtime) -> Option<Id>
Trait Implementations
sourceimpl<DB: ?Sized, Id> Ingredient<DB> for InputIngredient<Id>where
Id: InputId,
impl<DB: ?Sized, Id> Ingredient<DB> for InputIngredient<Id>where
Id: InputId,
sourcefn maybe_changed_after(
&self,
_db: &DB,
_input: DependencyIndex,
_revision: Revision
) -> bool
fn maybe_changed_after(
&self,
_db: &DB,
_input: DependencyIndex,
_revision: Revision
) -> bool
Has the value for
input
in this ingredient changed after revision
?sourcefn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy
If this ingredient is a participant in a cycle, what is its cycle recovery strategy?
(Really only relevant to
crate::function::FunctionIngredient
,
since only function ingredients push themselves onto the active query stack.) Read moresourcefn origin(&self, _key_index: Id) -> Option<QueryOrigin>
fn origin(&self, _key_index: Id) -> Option<QueryOrigin>
What were the inputs (if any) that were used to create the value at
key_index
.sourcefn mark_validated_output(
&self,
_db: &DB,
executor: DatabaseKeyIndex,
output_key: Option<Id>
)
fn mark_validated_output(
&self,
_db: &DB,
executor: DatabaseKeyIndex,
output_key: Option<Id>
)
Invoked when the value
output_key
should be marked as valid in the current revision.
This occurs because the value for executor
, which generated it, was marked as valid
in the current revision. Read moresourcefn remove_stale_output(
&self,
_db: &DB,
executor: DatabaseKeyIndex,
stale_output_key: Option<Id>
)
fn remove_stale_output(
&self,
_db: &DB,
executor: DatabaseKeyIndex,
stale_output_key: Option<Id>
)
Invoked when the value
stale_output
was output by executor
in a previous
revision, but was NOT output in the current revision. Read moresourcefn reset_for_new_revision(&mut self)
fn reset_for_new_revision(&mut self)
Invoked when a new revision is about to start.
This moment is important because it means that we have an
&mut
-reference to the
database, and hence any pre-existing &
-references must have expired.
Many ingredients, given an &'db
-reference to the database,
use unsafe code to return &'db
-references to internal values.
The backing memory for those values can only be freed once an &mut
-reference to the
database is created. Read moresourcefn salsa_struct_deleted(&self, _db: &DB, _id: Id)
fn salsa_struct_deleted(&self, _db: &DB, _id: Id)
Informs the ingredient
self
that the salsa struct with id id
has been deleted.
This gives self
a chance to remove any memoized data dependent on id
.
To receive this callback, self
must register itself as a dependent function using
SalsaStructInDb::register_dependent_fn
. Read morefn fmt_index(&self, index: Option<Id>, fmt: &mut Formatter<'_>) -> Result
sourceimpl<Id> IngredientRequiresReset for InputIngredient<Id>where
Id: InputId,
impl<Id> IngredientRequiresReset for InputIngredient<Id>where
Id: InputId,
sourceconst RESET_ON_NEW_REVISION: bool = false
const RESET_ON_NEW_REVISION: bool = false
If this is true, then
reset_for_new_revision
will be called every new revision.Auto Trait Implementations
impl<Id> RefUnwindSafe for InputIngredient<Id>where
Id: RefUnwindSafe,
impl<Id> Send for InputIngredient<Id>where
Id: Send,
impl<Id> Sync for InputIngredient<Id>where
Id: Sync,
impl<Id> Unpin for InputIngredient<Id>where
Id: Unpin,
impl<Id> UnwindSafe for InputIngredient<Id>where
Id: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more