echoloc 0.1.10

Generated by template 'rustyhorde-lib-template' by cargo-generate
Documentation
// Copyright (c) 2019 echoloc developers
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.

//! The `echoloc` runnable task trait
//!
//! # Example
//! ```
//! ```
//!

use std::result::Result;

/// The `Runnable` trait for tasks to implement
pub trait Runnable {
    /// The type of a successful result
    type Ok;
    /// The type of an error
    type Error: std::error::Error;

    /// Run the task
    fn run(&mut self) -> Result<Self::Ok, Self::Error>;
    /// Should the task be retried
    fn should_retry(&self, error: &Self::Error) -> bool;
    /// Store result
    fn store_result(&mut self, result: Result<Self::Ok, Self::Error>);
}