Struct ic_agent::agent::http_transport::HyperTransport
source · pub struct HyperTransport<B1, S = Client<HttpsConnector<HttpConnector>, B1>> { /* private fields */ }Available on crate feature
hyper only.Implementations§
source§impl<B1, S> HyperTransport<B1, S>
impl<B1, S> HyperTransport<B1, S>
sourcepub fn create_with_service<U: Into<String>>(
url: U,
service: S
) -> Result<Self, AgentError>
pub fn create_with_service<U: Into<String>>( url: U, service: S ) -> Result<Self, AgentError>
Creates a replica transport from a HTTP URL and a HyperService.
sourcepub fn create_with_service_route(
route_provider: Arc<dyn RouteProvider>,
service: S
) -> Result<Self, AgentError>
pub fn create_with_service_route( route_provider: Arc<dyn RouteProvider>, service: S ) -> Result<Self, AgentError>
Creates a replica transport from a RouteProvider and a HyperService.
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
Trait Implementations§
source§impl<B1, S> Transport for HyperTransport<B1, S>
impl<B1, S> Transport for HyperTransport<B1, S>
source§fn call(
&self,
effective_canister_id: Principal,
envelope: Vec<u8>,
_request_id: RequestId
) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + '_>>
fn call( &self, effective_canister_id: Principal, envelope: Vec<u8>, _request_id: RequestId ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + '_>>
Sends an asynchronous request to a replica. The Request ID is non-mutable and
depends on the content of the envelope. 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<B1, S> Freeze for HyperTransport<B1, S>where
S: Freeze,
impl<B1, S = Client<HttpsConnector<HttpConnector>, B1>> !RefUnwindSafe for HyperTransport<B1, S>
impl<B1, S> Send for HyperTransport<B1, S>where
S: Send,
impl<B1, S> Sync for HyperTransport<B1, S>where
S: Sync,
impl<B1, S> Unpin for HyperTransport<B1, S>where
S: Unpin,
impl<B1, S = Client<HttpsConnector<HttpConnector>, B1>> !UnwindSafe for HyperTransport<B1, S>
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