pub struct HttpCachedTransport {
client: Http<Client>,
block_number: Arc<AtomicU64>,
block_filters: Arc<RwLock<HashMap<U128, BlockNumber>>>,
block_hashes: Arc<RwLock<HashMap<BlockNumber, B256>>>,
cache_folder: Option<CacheFolder>,
}
Fields§
§client: Http<Client>
§block_number: Arc<AtomicU64>
§block_filters: Arc<RwLock<HashMap<U128, BlockNumber>>>
§block_hashes: Arc<RwLock<HashMap<BlockNumber, B256>>>
§cache_folder: Option<CacheFolder>
Implementations§
Source§impl HttpCachedTransport
impl HttpCachedTransport
pub async fn new(url: Url, cache_path: Option<&str>) -> Self
pub fn set_block_number(&self, block_number: u64) -> u64
fn convert_block_number( &self, number_or_tag: BlockNumberOrTag, ) -> Result<BlockNumberOrTag>
fn convert_block_number_next( &self, number_or_tag: BlockNumberOrTag, ) -> Result<BlockNumberOrTag>
pub async fn read_cached( &self, method: String, params_hash: B256, ) -> Result<String>
pub async fn write_cached( &self, method: String, params_hash: B256, data: String, ) -> Result<()>
pub fn next_block_number(&self) -> BlockNumber
pub async fn fetch_next_block(&self) -> Result<BlockNumber, TransportError>
pub fn read_block_number(&self) -> u64
pub async fn create_block_filter(&self) -> U128
pub async fn get_block_number(self) -> Result<ResponsePacket, TransportError>
pub async fn new_block_filter(self) -> Result<ResponsePacket, TransportError>
pub async fn get_filter_changes( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn cached_or_execute( &self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn eth_call( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn eth_get_storage_at( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn eth_get_block_by_number( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn eth_get_block_by_hash( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn debug_trace_block_by_number( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn debug_trace_call( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn debug_trace_block_by_hash( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
pub async fn eth_get_logs( self, req: SerializedRequest, ) -> Result<ResponsePacket, TransportError>
Trait Implementations§
Source§impl Clone for HttpCachedTransport
impl Clone for HttpCachedTransport
Source§fn clone(&self) -> HttpCachedTransport
fn clone(&self) -> HttpCachedTransport
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Service<RequestPacket> for HttpCachedTransport
impl Service<RequestPacket> for HttpCachedTransport
Source§type Future = Pin<Box<dyn Future<Output = Result<ResponsePacket, RpcError<TransportErrorKind>>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<ResponsePacket, RpcError<TransportErrorKind>>> + Send>>
The future response value.
Auto Trait Implementations§
impl Freeze for HttpCachedTransport
impl !RefUnwindSafe for HttpCachedTransport
impl Send for HttpCachedTransport
impl Sync for HttpCachedTransport
impl Unpin for HttpCachedTransport
impl !UnwindSafe for HttpCachedTransport
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T, Request> ServiceExt<Request> for Twhere
T: Service<Request> + ?Sized,
impl<T, Request> ServiceExt<Request> for Twhere
T: Service<Request> + ?Sized,
§fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
Yields a mutable reference to the service when it is ready to accept a request.
§fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
Yields the service when it is ready to accept a request.
§fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
Consume this
Service
, calling it with the provided request once it is ready.§fn and_then<F>(self, f: F) -> AndThen<Self, F>
fn and_then<F>(self, f: F) -> AndThen<Self, F>
Executes a new future after this service’s future resolves. This does
not alter the behaviour of the
poll_ready
method. Read more§fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
Maps this service’s response value to a different value. This does not
alter the behaviour of the
poll_ready
method. Read more§fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
Maps this service’s error value to a different value. This does not
alter the behaviour of the
poll_ready
method. Read more§fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
Maps this service’s result type (
Result<Self::Response, Self::Error>
)
to a different value, regardless of whether the future succeeds or
fails. Read more§fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
Composes a function in front of the service. Read more
§fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
Composes an asynchronous function after this service. Read more
§fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
Composes a function that transforms futures produced by the service. Read more
§impl<T> Transport for T
impl<T> Transport for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 144 bytes