Session

Trait Session 

Source
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§

Source

fn should_procede(&mut self, url: &Url) -> bool

Returns false if a request to the given URL should not procede

Source

fn mark_success(&mut self, url: &Url)

Update the session from a successful request

Source

fn mark_failure(&mut self, url: &Url)

Update the session from a failed request

Implementations on Foreign Types§

Source§

impl Session for ()

Source§

fn should_procede(&mut self, _: &Url) -> bool

Source§

fn mark_success(&mut self, _: &Url)

Source§

fn mark_failure(&mut self, _: &Url)

Source§

impl<'a, T> Session for &'a mut T
where T: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Source§

impl<T> Session for Box<T>
where T: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Source§

impl<T, U> Session for (T, U)
where T: Session, U: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Source§

impl<T, U, V> Session for (T, U, V)
where T: Session, U: Session, V: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Source§

impl<T, U, V, W> Session for (T, U, V, W)
where T: Session, U: Session, V: Session, W: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Source§

impl<T, U, V, W, X> Session for (T, U, V, W, X)
where T: Session, U: Session, V: Session, W: Session, X: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Source§

impl<T, U, V, W, X, Y> Session for (T, U, V, W, X, Y)
where T: Session, U: Session, V: Session, W: Session, X: Session, Y: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Source§

impl<T, U, V, W, X, Y, Z> Session for (T, U, V, W, X, Y, Z)
where T: Session, U: Session, V: Session, W: Session, X: Session, Y: Session, Z: Session,

Source§

fn should_procede(&mut self, url: &Url) -> bool

Source§

fn mark_success(&mut self, url: &Url)

Source§

fn mark_failure(&mut self, url: &Url)

Implementors§