pub trait SourceContext: StateWrite {
// Provided methods
fn put_current_source(&mut self, source: Option<CommitmentSource>) { ... }
fn get_current_source(&self) -> Option<CommitmentSource> { ... }
fn put_mock_source(&mut self, counter: u8) { ... }
}
Available on crate feature
component
only.Expand description
A helper trait for placing a CommitmentSource
as ambient context during execution.
Provided Methods§
fn put_current_source(&mut self, source: Option<CommitmentSource>)
fn get_current_source(&self) -> Option<CommitmentSource>
Sourcefn put_mock_source(&mut self, counter: u8)
fn put_mock_source(&mut self, counter: u8)
Sets a mock source, for testing.
The counter
field allows distinguishing hashes at different stages of the test.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.