pub struct ReqwestTransport { /* private fields */ }
Implementations§
source§impl ReqwestTransport
impl ReqwestTransport
sourcepub fn create<U: Into<String>>(url: U) -> Result<Self, AgentError>
pub fn create<U: Into<String>>(url: U) -> Result<Self, AgentError>
Creates a replica transport from a HTTP URL. By default a request timeout of 6 minutes is used.
Use create_with_client
to configure this and other client options.
sourcepub fn create_with_client<U: Into<String>>(
url: U,
client: Client,
) -> Result<Self, AgentError>
pub fn create_with_client<U: Into<String>>( url: U, client: Client, ) -> Result<Self, AgentError>
Creates a replica transport from a HTTP URL and a reqwest::Client
.
sourcepub fn create_with_client_route(
route_provider: Arc<dyn RouteProvider>,
client: Client,
) -> Result<Self, AgentError>
pub fn create_with_client_route( route_provider: Arc<dyn RouteProvider>, client: Client, ) -> Result<Self, AgentError>
Creates a replica transport from a RouteProvider
and a reqwest::Client
.
sourcepub fn with_max_response_body_size(self, max_response_body_size: usize) -> Self
pub fn with_max_response_body_size(self, max_response_body_size: usize) -> Self
Sets a max response body size limit
sourcepub fn with_max_tcp_errors_retries(self, retries: usize) -> Self
pub fn with_max_tcp_errors_retries(self, retries: usize) -> Self
Sets a max number of retries for tcp connection errors.
Trait Implementations§
source§impl Debug for ReqwestTransport
impl Debug for ReqwestTransport
source§impl Transport for ReqwestTransport
impl Transport for ReqwestTransport
source§fn call(
&self,
effective_canister_id: Principal,
envelope: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<TransportCallResponse, AgentError>> + Send + '_>>
fn call( &self, effective_canister_id: Principal, envelope: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<TransportCallResponse, AgentError>> + Send + '_>>
Sends a synchronous call request to a replica. Read more
source§fn read_state(
&self,
effective_canister_id: Principal,
envelope: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
fn read_state( &self, effective_canister_id: Principal, envelope: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
Sends a synchronous request to a replica. This call includes the body of the request message
itself (envelope). Read more
source§fn read_subnet_state(
&self,
subnet_id: Principal,
envelope: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
fn read_subnet_state( &self, subnet_id: Principal, envelope: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
Sends a synchronous request to a replica. This call includes the body of the request message
itself (envelope). Read more
source§fn query(
&self,
effective_canister_id: Principal,
envelope: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
fn query( &self, effective_canister_id: Principal, envelope: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
Sends a synchronous request to a replica. This call includes the body of the request message
itself (envelope). Read more
source§fn status(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
fn status( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + Send + '_>>
Sends a status request to the replica, returning whatever the replica returns.
In the current spec v2, this is a CBOR encoded status message, but we are not
making this API attach semantics to the response.
Auto Trait Implementations§
impl Freeze for ReqwestTransport
impl !RefUnwindSafe for ReqwestTransport
impl Send for ReqwestTransport
impl Sync for ReqwestTransport
impl Unpin for ReqwestTransport
impl !UnwindSafe for ReqwestTransport
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