pub struct Provider { /* private fields */ }Expand description
A interface over a light client instance and its RPC client.
Implementations§
Source§impl Provider
impl Provider
pub fn new(chain_id: String, instance: Instance, rpc_client: HttpClient) -> Self
pub fn chain_id(&self) -> &str
pub fn peer_id(&self) -> &Id
pub async fn report_evidence( &self, evidence: Evidence, ) -> Result<Hash, RpcError>
pub fn fetch_light_block(&self, height: Height) -> Result<LightBlock, Error>
pub fn verify_to_highest(&mut self) -> Result<LightBlock, Error>
pub fn verify_to_height(&mut self, height: Height) -> Result<LightBlock, Error>
pub fn verify_to_height_with_state( &self, height: Height, state: &mut State, ) -> Result<LightBlock, Error>
pub fn get_target_block_or_latest( &mut self, height: Height, ) -> Result<TargetOrLatest, Error>
pub fn get_trace(&self, height: Height) -> Vec<LightBlock>
pub fn latest_trusted(&self) -> Option<LightBlock>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Provider
impl !RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl !UnwindSafe for Provider
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