pub trait SourceContext: StateWrite {
// Provided methods
fn put_current_source(&mut self, source: Option<TransactionId>) { ... }
fn get_current_source(&self) -> Option<TransactionId> { ... }
fn put_mock_source(&mut self, counter: u8) { ... }
}
Available on crate feature
component
only.Expand description
A helper trait for placing a transaction id as an ambient source during execution.
Provided Methods§
fn put_current_source(&mut self, source: Option<TransactionId>)
fn get_current_source(&self) -> Option<TransactionId>
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.