pub struct SourceSession { /* private fields */ }Implementations§
Source§impl SourceSession
impl SourceSession
pub fn prepare(&self, source: &str) -> Result<CheckedSubmission, Diagnostic>
Sourcepub fn prepare_replace(
&self,
source: &str,
) -> Result<CheckedSubmission, Diagnostic>
pub fn prepare_replace( &self, source: &str, ) -> Result<CheckedSubmission, Diagnostic>
Prepare a submission that explicitly replaces matching top-level declarations
using projectional::Edit::ReplaceItem with full rollback on failure.
Sourcepub fn prepare_edit(&self, edit: &Edit) -> Result<CheckedSubmission, Diagnostic>
pub fn prepare_edit(&self, edit: &Edit) -> Result<CheckedSubmission, Diagnostic>
Prepare an incremental projectional::Edit against the retained session program.
Returns an error without mutating session state if bounds, limits, or checks fail.
Source§impl SourceSession
impl SourceSession
pub fn new(grants: Vec<String>, limits: SessionLimits) -> Self
pub fn revision(&self) -> u64
Sourcepub fn bindings(&self) -> SessionBindings<'_>
pub fn bindings(&self) -> SessionBindings<'_>
Read-only accepted bindings, using the same view as tentative validation.
pub fn value(&self, name: &str) -> Option<&Value>
pub fn is_mutable(&self, name: &str) -> bool
pub fn sources(&self) -> &[String]
pub fn binding_type(&self, name: &str) -> Option<String>
pub fn submit<H: Host>( &mut self, source: &str, host: &mut H, budget: Budget, ) -> Result<SubmissionResult, SubmissionError>
Sourcepub fn submit_validated<H: Host, F: FnOnce(&Value) -> Result<(), Diagnostic>>(
&mut self,
source: &str,
host: &mut H,
budget: Budget,
validate: F,
) -> Result<SubmissionResult, SubmissionError>
pub fn submit_validated<H: Host, F: FnOnce(&Value) -> Result<(), Diagnostic>>( &mut self, source: &str, host: &mut H, budget: Budget, validate: F, ) -> Result<SubmissionResult, SubmissionError>
Validate evaluated output before promoting any tentative local values, definitions or source. Host effects already attempted are not rolled back.
Sourcepub fn submit_validated_bindings<H: Host, F>(
&mut self,
source: &str,
host: &mut H,
budget: Budget,
validate: F,
) -> Result<SubmissionResult, SubmissionError>
pub fn submit_validated_bindings<H: Host, F>( &mut self, source: &str, host: &mut H, budget: Budget, validate: F, ) -> Result<SubmissionResult, SubmissionError>
Validate tentative bindings and result using the same host before local promotion. Dispatched host effects are not automatically rolled back.
pub fn execute<H: Host>( &mut self, candidate: CheckedSubmission, host: &mut H, budget: Budget, ) -> Result<SubmissionResult, SubmissionError>
Sourcepub fn apply_edit<H: Host>(
&mut self,
edit: &Edit,
host: &mut H,
budget: Budget,
) -> Result<SubmissionResult, SubmissionError>
pub fn apply_edit<H: Host>( &mut self, edit: &Edit, host: &mut H, budget: Budget, ) -> Result<SubmissionResult, SubmissionError>
Apply a structural projectional::Edit and re-evaluate the session.
Any parse, check, or evaluation failure rolls back all session state.
Sourcepub fn replace<H: Host>(
&mut self,
source: &str,
host: &mut H,
budget: Budget,
) -> Result<SubmissionResult, SubmissionError>
pub fn replace<H: Host>( &mut self, source: &str, host: &mut H, budget: Budget, ) -> Result<SubmissionResult, SubmissionError>
Submit source with explicit replacement of matching top-level declarations. Any check or evaluation failure rolls back all session state.
Sourcepub fn execute_validated<H: Host, F: FnOnce(&Value) -> Result<(), Diagnostic>>(
&mut self,
candidate: CheckedSubmission,
host: &mut H,
budget: Budget,
validate: F,
) -> Result<SubmissionResult, SubmissionError>
pub fn execute_validated<H: Host, F: FnOnce(&Value) -> Result<(), Diagnostic>>( &mut self, candidate: CheckedSubmission, host: &mut H, budget: Budget, validate: F, ) -> Result<SubmissionResult, SubmissionError>
The validator receives actual evaluated output once, after interpreter checks and before promotion. It may recheck native authority while its owner transaction is held; no JSON receipt is treated as authority.
Sourcepub fn execute_validated_bindings<H: Host, F>(
&mut self,
candidate: CheckedSubmission,
host: &mut H,
budget: Budget,
validate: F,
) -> Result<SubmissionResult, SubmissionError>
pub fn execute_validated_bindings<H: Host, F>( &mut self, candidate: CheckedSubmission, host: &mut H, budget: Budget, validate: F, ) -> Result<SubmissionResult, SubmissionError>
Inspect tentative bindings and debit the actual host before promotion. A rejected callback preserves local source/session state. Any already dispatched external host effects still require reconciliation.