pub trait Session {
// Required methods
fn should_procede(&mut self, url: &Url) -> bool;
fn mark_success(&mut self, url: &Url);
fn mark_failure(&mut self, url: &Url);
}Expand description
Describes types that track requests
The Session type can be included by downstream client implementations as a generic middleware interface for deciding when requests should or should not continue.
An included RequestCountSession type is included, which simply counts how many requests the
session has observed and indicates future requests shouldn’t be executed after it’s limit is
hit.
Required Methods§
Sourcefn should_procede(&mut self, url: &Url) -> bool
fn should_procede(&mut self, url: &Url) -> bool
Returns false if a request to the given URL should not procede
Sourcefn mark_success(&mut self, url: &Url)
fn mark_success(&mut self, url: &Url)
Update the session from a successful request
Sourcefn mark_failure(&mut self, url: &Url)
fn mark_failure(&mut self, url: &Url)
Update the session from a failed request