pub trait RequestableInner: Send + Sync {
// Required methods
fn make_request(&self) -> Result<Request<RequestBody>, RequestError>;
fn partial_response_body_ok(&self) -> bool;
fn max_response_len(&self) -> usize;
fn anonymized(&self) -> AnonymizedRequest;
// Provided method
fn check_circuit_skip_optimization<'a>(
&self,
tunnel: &'a ClientDirTunnel,
) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'a>> { ... }
}Expand description
Sealed trait to help implement Requestable: not
visible outside this crate, so we can change its methods however we like.
Required Methods§
Sourcefn make_request(&self) -> Result<Request<RequestBody>, RequestError>
fn make_request(&self) -> Result<Request<RequestBody>, RequestError>
Build an http::Request from this Requestable, if
it is well-formed.
Sourcefn partial_response_body_ok(&self) -> bool
fn partial_response_body_ok(&self) -> bool
Return true if partial response bodies are potentially useful.
This is true for request types where we’re going to be downloading multiple documents, and we know how to parse out the ones we wanted if the answer is truncated.
Sourcefn max_response_len(&self) -> usize
fn max_response_len(&self) -> usize
Return the maximum allowable response length we’ll accept for this request.
Sourcefn anonymized(&self) -> AnonymizedRequest
fn anonymized(&self) -> AnonymizedRequest
Return a value to say whether this request must be anonymized.
Provided Methods§
Sourcefn check_circuit_skip_optimization<'a>(
&self,
tunnel: &'a ClientDirTunnel,
) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'a>>
fn check_circuit_skip_optimization<'a>( &self, tunnel: &'a ClientDirTunnel, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'a>>
Optimization: return an error if there is some problem with the provided circuit that makes it unlikely to be useful for this request.
Do not use this method to check for security properties.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl RequestableInner for Arc<dyn Requestable>
impl RequestableInner for Arc<dyn Requestable>
fn make_request(&self) -> Result<Request<RequestBody>, RequestError>
fn partial_response_body_ok(&self) -> bool
fn anonymized(&self) -> AnonymizedRequest
fn max_response_len(&self) -> usize
fn check_circuit_skip_optimization<'a>( &self, tunnel: &'a ClientDirTunnel, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'a>>
Implementors§
impl RequestableInner for AuthCertRequest
impl RequestableInner for ConsensusRequest
impl RequestableInner for ExtraInfoRequest
routerdesc only.impl RequestableInner for HsDescDownloadRequest
hs-client only.impl RequestableInner for HsDescUploadRequest
impl RequestableInner for MicrodescRequest
impl RequestableInner for RouterDescRequest
routerdesc only.impl RequestableInner for RoutersOwnDescRequest
routerdesc only.