Resource

Struct Resource 

Source
pub struct Resource { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl CellDataProvider for Resource

Source§

fn load_cell_data(&self, cell: &CellMeta) -> Option<Bytes>

load cell_data from memory, fallback to storage access
Source§

fn get_cell_data(&self, out_point: &OutPoint) -> Option<Bytes>

fetch cell_data from storage
Source§

fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>

fetch cell_data_hash from storage
Source§

fn load_cell_data_hash(&self, cell: &CellMeta) -> Option<Byte32>

load cell_data_hash from memory, fallback to storage access
Source§

impl CellProvider for Resource

Source§

fn cell(&self, out_point: &OutPoint, _with_data: bool) -> CellStatus

TODO(doc): @quake
Source§

impl<'a> HeaderChecker for Resource

Source§

fn check_valid(&self, block_hash: &Byte32) -> Result<(), OutPointError>

Check if header in main chain
Source§

impl HeaderProvider for Resource

Source§

fn get_header(&self, hash: &Byte32) -> Option<HeaderView>

TODO(doc): @quake
Source§

fn timestamp_and_parent(&self, block_hash: &Byte32) -> (u64, u64, Byte32)

Return timestamp and block_number of the corresponding block_hash, and hash of parent block
Source§

fn block_median_time( &self, block_hash: &Byte32, median_block_count: usize, ) -> u64

Return past block median time, including the timestamp of the given one

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V