Trait RequestableInner

Source
pub trait RequestableInner: Send + Sync {
    // Required methods
    fn make_request(&self) -> Result<Request<String>, RequestError>;
    fn partial_response_body_ok(&self) -> bool;
    fn anonymized(&self) -> AnonymizedRequest;

    // Provided methods
    fn max_response_len(&self) -> usize { ... }
    fn check_circuit<'a>(
        &self,
        circ: &'a ClientCirc,
    ) -> 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§

Source

fn make_request(&self) -> Result<Request<String>, RequestError>

Build an [http::Request] from this Requestable, if it is well-formed.

Source

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.

Source

fn anonymized(&self) -> AnonymizedRequest

Return a value to say whether this request must be anonymized.

Provided Methods§

Source

fn max_response_len(&self) -> usize

Return the maximum allowable response length we’ll accept for this request.

Source

fn check_circuit<'a>( &self, circ: &'a ClientCirc, ) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'a>>

Return an error if there is some problem with the provided circuit that would keep it from being used for this request.

Implementors§

Source§

impl RequestableInner for AuthCertRequest

Source§

impl RequestableInner for ConsensusRequest

Source§

impl RequestableInner for HsDescDownloadRequest

Available on crate feature hs-client only.
Source§

impl RequestableInner for HsDescUploadRequest

Available on crate feature hs-service only.
Source§

impl RequestableInner for MicrodescRequest

Source§

impl RequestableInner for RouterDescRequest

Available on crate feature routerdesc only.
Source§

impl RequestableInner for RoutersOwnDescRequest

Available on crate feature routerdesc only.