pub struct Resource { /* private fields */ }
Expand description
The struct holds the necessary cells, headers, and extensions for validating a transaction.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn from_mock_tx(mock_tx: &MockTransaction) -> Result<Resource, String>
pub fn from_mock_tx(mock_tx: &MockTransaction) -> Result<Resource, String>
Create a resource from a mock transaction.
Sourcepub fn from_both<L: MockResourceLoader>(
mock_tx: &MockTransaction,
loader: &mut L,
) -> Result<Resource, String>
pub fn from_both<L: MockResourceLoader>( mock_tx: &MockTransaction, loader: &mut L, ) -> Result<Resource, String>
Create a resource from both mock transaction and a resource loader.
Trait Implementations§
Source§impl CellDataProvider for Resource
impl CellDataProvider for Resource
Source§fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>
fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>
Fetch cell_data_hash from storage, please note that loading a large amount of cell data
and calculating hash may be a performance bottleneck, so here is a separate fn designed
to facilitate caching. Read more
Source§impl CellProvider for Resource
impl CellProvider for Resource
Source§impl ExtensionProvider for Resource
impl ExtensionProvider for Resource
Source§impl HeaderChecker for Resource
impl HeaderChecker for Resource
Source§fn check_valid(&self, block_hash: &Byte32) -> Result<(), OutPointError>
fn check_valid(&self, block_hash: &Byte32) -> Result<(), OutPointError>
Check if header in main chain
Source§impl HeaderProvider for Resource
impl HeaderProvider for Resource
Source§fn get_header(&self, block_hash: &Byte32) -> Option<HeaderView>
fn get_header(&self, block_hash: &Byte32) -> Option<HeaderView>
Get the header of the given block hash
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)