pub trait Requestable {
    // Required methods
    fn make_request(&self) -> Result<Request<()>, RequestError>;
    fn partial_docs_ok(&self) -> bool;

    // Provided methods
    fn max_response_len(&self) -> usize { ... }
    fn check_circuit(&self, circ: &ClientCirc) -> Result<(), RequestError> { ... }
}
Expand description

A request for an object that can be served over the Tor directory system.

Required Methods§

source

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

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

source

fn partial_docs_ok(&self) -> bool

Return true if partial downloads are potentially useful. This is true for request types where we’re going to be downloading multiple documents.

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(&self, circ: &ClientCirc) -> Result<(), RequestError>

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 Requestable for AuthCertRequest

source§

impl Requestable for ConsensusRequest

source§

impl Requestable for HsDescDownloadRequest

Available on crate feature hs-client only.
source§

impl Requestable for MicrodescRequest

source§

impl Requestable for RouterDescRequest

Available on crate feature routerdesc only.
source§

impl Requestable for RoutersOwnDescRequest

Available on crate feature routerdesc only.