mirror of
https://github.com/tower-rs/tower.git
synced 2025-09-27 13:00:43 +00:00
timeout: Add Elapsed::new
and prepare 0.1.1 release (#308)
* Add Elapsed::new * Prep tower-timeout 0.1.1 release
This commit is contained in:
parent
72219ce862
commit
26d096bd99
@ -1,3 +1,7 @@
|
||||
# 0.1.1 (July 30th, 2019)
|
||||
|
||||
- Add `Elapsed::new`
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
||||
|
@ -8,13 +8,13 @@ name = "tower-timeout"
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-timeout/0.1.0"
|
||||
documentation = "https://docs.rs/tower-timeout/0.1.1"
|
||||
description = """
|
||||
Apply a timeout to requests, ensuring completion within a fixed time duration.
|
||||
"""
|
||||
|
@ -8,6 +8,13 @@ pub(crate) type Error = Box<dyn error::Error + Send + Sync>;
|
||||
#[derive(Debug)]
|
||||
pub struct Elapsed(pub(super) ());
|
||||
|
||||
impl Elapsed {
|
||||
/// Construct a new elapsed error
|
||||
pub fn new() -> Self {
|
||||
Elapsed(())
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Elapsed {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.pad("request timed out")
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![doc(html_root_url = "https://docs.rs/tower-timeout/0.1.0")]
|
||||
#![doc(html_root_url = "https://docs.rs/tower-timeout/0.1.1")]
|
||||
#![deny(missing_debug_implementations, missing_docs, rust_2018_idioms)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
#![cfg_attr(test, deny(warnings))]
|
||||
|
Loading…
x
Reference in New Issue
Block a user