commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
1ad9a49080ae3e7576cbe858aac6e4c78c503ba0
Paul Woolcock
2017-04-01T13:27:07
make sure no windows stuff gets compiled on linux (#1)
diff --git a/src/fs.rs b/src/fs.rs index 1a4deef..f788c61 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -3,7 +3,12 @@ use std::fs::{self, File, OpenOptions}; use std::{io, ptr}; use std::os::windows::prelude::*; use std::path::{Path, PathBuf}; -use super::*; + +use winapi::*; +use kernel::*; + +pub const ERROR_I...
2
55
56
f53e74c59e344045462bc8ab27c15d0bcbd5b3b1
Xuanwo
2025-10-18T18:14:32
refactor: Add RetryConfig to make code simple (#224) This PR adds `RetryConfig` to make it's easier to maintain the retry behavior logic. --- **This PR was primarily authored with Codex using GPT-5-Codex and then hand-reviewed by me. I AM responsible for every change made in this PR. I aimed to keep it aligned with ...
diff --git a/backon/src/blocking_retry.rs b/backon/src/blocking_retry.rs index c7d18a5..e6024d8 100644 --- a/backon/src/blocking_retry.rs +++ b/backon/src/blocking_retry.rs @@ -1,3 +1,4 @@ +use core::ops::ControlFlow; use core::time::Duration; use crate::Backoff; @@ -5,6 +6,10 @@ use crate::BlockingSleeper; use cr...
6
235
174
e24dc92742e201f7320868d46a12ff59eb82ef72
Xuanwo
2025-10-18T14:25:41
Bump to version 1.6.0 (#218) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 1702ce8..fba5aa2 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.85" -version = "1.5.2" +version = "1.6.0" edition.workspace = true li...
1
1
1
dba17424f9e2bfc8e575d71d2741a95bfb4c70be
Xuanwo
2025-10-18T11:47:48
chore: Migrate doc_auto_cfg (#215) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/lib.rs b/backon/src/lib.rs index 6f45d63..ae03d50 100644 --- a/backon/src/lib.rs +++ b/backon/src/lib.rs @@ -1,7 +1,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/Xuanwo/backon/main/.github/assets/logo.jpeg" )] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(doc...
1
1
1
de0a04105bb6cb42fecb82122e7afbee28c24cd5
Marc-Antoine Perennou
2025-09-14T09:20:48
refactor: drop constraint on Future's Output (#213)
diff --git a/backon/src/blocking_sleep.rs b/backon/src/blocking_sleep.rs index 5f5c09d..2540631 100644 --- a/backon/src/blocking_sleep.rs +++ b/backon/src/blocking_sleep.rs @@ -36,6 +36,7 @@ pub type DefaultBlockingSleeper = StdSleeper; /// /// Users should enable a feature of this crate that provides a valid [`Sleep...
5
11
9
db212c04e784b04eefc59ba630048500777c0227
Xuanwo
2025-07-30T09:44:24
Bump to version 1.5.2 (#207) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 42d63e2..da3ebe2 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.70" -version = "1.5.1" +version = "1.5.2" edition.workspace = true li...
1
1
1
250649ac7d431d889a1bbb2b3a8a8e0ccde98bad
Tino Breddin
2025-07-30T09:25:25
fix(api): Expose FuturesTimerSleeper properly (#205) Also fix name inconsistencies.
diff --git a/backon/src/lib.rs b/backon/src/lib.rs index 61f5acb..6dfca64 100644 --- a/backon/src/lib.rs +++ b/backon/src/lib.rs @@ -41,13 +41,13 @@ //! environments, they are gated under their own features, which are enabled //! by default: //! -//! | `Sleeper` | feature | Environment | Async...
2
11
9
2413c8fff316e751c978d4c35b3b3781c8b539a0
Xuanwo
2025-05-29T07:32:13
Bump to version 1.5.1 (#200) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 2df2114..42d63e2 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.70" -version = "1.5.0" +version = "1.5.1" edition.workspace = true li...
1
1
1
d1d394110fbbc5c71c94c16ba534bcaf97df959b
Sherlock Holo
2025-05-29T07:27:05
fix no sleeper feature can't set sleeper in retry with context (#199)
diff --git a/backon/src/retry_with_context.rs b/backon/src/retry_with_context.rs index 0837aa0..3cda9a6 100644 --- a/backon/src/retry_with_context.rs +++ b/backon/src/retry_with_context.rs @@ -145,7 +145,7 @@ where B: Backoff, Fut: Future<Output = (Ctx, Result<T, E>)>, FutureFn: FnMut(Ctx) -> Fut, - S...
1
1
1
38acd5ddc109890aa01a9730b00c411ac0a15127
Xuanwo
2025-04-09T09:16:16
Bump version to 1.5.0 (#194) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 14ade5e..2df2114 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.70" -version = "1.4.1" +version = "1.5.0" edition.workspace = true li...
1
1
1
1395a9ca8060513bdd79fcddb696e1e7a5bbed1c
xmchx
2025-04-09T09:12:02
feat: Allow to control the max sleep time of exponential backoff (#187) Closes #149 --------- Signed-off-by: Xuanwo <github@xuanwo.io> Co-authored-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/backoff/exponential.rs b/backon/src/backoff/exponential.rs index dd94ed0..584ce53 100644 --- a/backon/src/backoff/exponential.rs +++ b/backon/src/backoff/exponential.rs @@ -41,6 +41,7 @@ pub struct ExponentialBuilder { min_delay: Duration, max_delay: Option<Duration>, max_times: O...
1
51
2
19cb6410c184df991b5f31cda9eb9f154b35cd39
Xuanwo
2025-03-19T09:04:27
Bump to version 1.4.1 (#185) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index ba5f109..3abb100 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.70" -version = "1.4.0" +version = "1.4.1" edition.workspace = true li...
1
21
19
85ff0b1b0be75502438f09b04833a0a8a6c6e2d8
Daniel Shaulov
2025-03-19T08:57:54
jitter: Make jitter range to current_delay instead of min_delay (#184) Currently in exponential and fibonacci the jitter adds a value between 0 and min_delay, which might be very small when compared to the end of the max_delay. So when reaching max_delay, and when many different endpoints use the backoff algorithm, th...
diff --git a/backon/src/backoff/exponential.rs b/backon/src/backoff/exponential.rs index 0639753..dd94ed0 100644 --- a/backon/src/backoff/exponential.rs +++ b/backon/src/backoff/exponential.rs @@ -65,7 +65,7 @@ impl ExponentialBuilder { /// Enable jitter for the backoff. /// - /// When jitter is enabled,...
2
4
4
a1351c2b8c04cb3c34d9522626e276ff7804f19e
Matt3o12
2025-02-18T09:58:56
feat: Mark builders to be const (#172) Hello thank you for your work. I have made changes so that all builders are now const. They should still be 100% backwards compadible. I had to introduce a constructor, new, as Default cannot be const just yet. This allows me to define a const builder at the top and use it lik...
diff --git a/backon/src/backoff/constant.rs b/backon/src/backoff/constant.rs index 277abd6..959e667 100644 --- a/backon/src/backoff/constant.rs +++ b/backon/src/backoff/constant.rs @@ -41,6 +41,13 @@ pub struct ConstantBuilder { impl Default for ConstantBuilder { fn default() -> Self { + Self::new() + ...
3
88
32
bce8d39d7f8bcd52affeeba0e192004667574990
wackazong
2025-02-18T08:59:20
feat: add explanation of Backoff trait to README (#177)
diff --git a/backon/src/lib.rs b/backon/src/lib.rs index e691daf..729fabb 100644 --- a/backon/src/lib.rs +++ b/backon/src/lib.rs @@ -21,7 +21,7 @@ //! //! # Backoff //! -//! Retry in BackON requires a backoff strategy. BackON will accept a [`BackoffBuilder`] which will generate a new [`Backoff`] for each retry. +//!...
1
1
1
45e917049cc88d71d96deb1aea06ab61c0a8f3df
Lukas
2024-12-27T02:45:47
feat: add Sleeper based on `futures-timer` (#154)
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 8ef5d53..d23d79c 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -25,6 +25,7 @@ std = ["fastrand/std"] std-blocking-sleep = [] gloo-timers-sleep = ["gloo-timers/futures"] tokio-sleep = ["tokio/time"] +futures-timer-sleep = ["futures-timer"] embassy-...
3
29
6
1582dbc28baeac3ff08ca35444a0bbbd44c24d4b
wackazong
2024-12-26T04:20:17
feat: Add embassy-based sleeper for no_std (#173)
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index d6bd83e..8ef5d53 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -25,9 +25,11 @@ std = ["fastrand/std"] std-blocking-sleep = [] gloo-timers-sleep = ["gloo-timers/futures"] tokio-sleep = ["tokio/time"] +embassy-sleep = ["embassy-time"] [dependencie...
3
28
0
f7e3b97dd07420b92bdfd7130605cb8efb92accd
wackazong
2024-12-17T14:41:35
feat: Add std support for no-std without global rand seed (#169) Split https://github.com/Xuanwo/backon/pull/168 into two PRs as requested, this is the one for no_std support. --------- Co-authored-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index de9d2c1..d6bd83e 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -20,13 +20,14 @@ targets = [ ] [features] -default = ["std-blocking-sleep", "tokio-sleep", "gloo-timers-sleep"] +default = ["std", "std-blocking-sleep", "tokio-sleep", "gloo-timers-sle...
11
91
15
c574c61ae49ce1d4204ede2dfc7272cc23651dbe
wackazong
2024-11-29T16:32:25
chore: Remove unnecessary optional feature selectors (#167)
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 07d7468..de9d2c1 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -22,8 +22,8 @@ targets = [ [features] default = ["std-blocking-sleep", "tokio-sleep", "gloo-timers-sleep"] std-blocking-sleep = [] -gloo-timers-sleep = ["dep:gloo-timers", "gloo-timers?...
1
2
2
893ffca05c182d2b6b206510f54caeff6223a75c
Xuanwo
2024-11-22T06:22:25
Bump version to 1.3.0 (#164)
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 1caf728..07d7468 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.70" -version = "1.2.0" +version = "1.3.0" edition.workspace = true li...
1
1
1
0e145757000c86aa335916fc420de28b8046efc7
nardoor
2024-11-22T06:11:10
feat: builder_without_max_(times|delay) (#160)
diff --git a/backon/src/backoff/constant.rs b/backon/src/backoff/constant.rs index bba2fb3..117b156 100644 --- a/backon/src/backoff/constant.rs +++ b/backon/src/backoff/constant.rs @@ -68,6 +68,16 @@ impl ConstantBuilder { self.jitter = true; self } + + /// Set no max times for the backoff. + ...
3
139
14
073c74416a0edc64d8ee6cfead596d72ad1a3079
Shikhar Bhushan
2024-11-22T06:07:51
fix: doc for `with_max_times` (#161)
diff --git a/backon/src/backoff/constant.rs b/backon/src/backoff/constant.rs index 39aa918..bba2fb3 100644 --- a/backon/src/backoff/constant.rs +++ b/backon/src/backoff/constant.rs @@ -55,7 +55,7 @@ impl ConstantBuilder { self } - /// Set the maximum duration for the backoff. + /// Set the maximum...
1
1
1
781b3670a08d5c979c69e70b1eb17346eef15054
Xuanwo
2024-10-07T03:50:02
chore: Polish impl of saturating_mul (#151) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/backoff/exponential.rs b/backon/src/backoff/exponential.rs index 780289b..cee9932 100644 --- a/backon/src/backoff/exponential.rs +++ b/backon/src/backoff/exponential.rs @@ -182,10 +182,7 @@ impl Iterator for ExponentialBackoff { #[inline] pub(crate) fn saturating_mul(d: Duration, rhs: f32) -...
1
1
4
ac8445185929b6589265ceb5b47ddc1b96663d3b
Xuanwo
2024-09-05T06:51:50
feat: Allow users to use &XxxBuilder (#148) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/backoff/api.rs b/backon/src/backoff/api.rs index 5c65b70..0f5b5cb 100644 --- a/backon/src/backoff/api.rs +++ b/backon/src/backoff/api.rs @@ -27,6 +27,7 @@ impl<B: Backoff> BackoffBuilder for B { #[cfg(test)] mod tests { use super::*; + use crate::{ConstantBuilder, ExponentialBuilder, F...
4
34
1
a379d628834b01c7965b9c01e1865f6f0df46f1b
Xuanwo
2024-09-04T11:56:16
feat: Implement BackoffBuilder for Backoff itself (#142) Signed-off-by: Xuanwo <github@xuanwo.io> Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/backoff/api.rs b/backon/src/backoff/api.rs index 2481618..5c65b70 100644 --- a/backon/src/backoff/api.rs +++ b/backon/src/backoff/api.rs @@ -1,5 +1,12 @@ use core::time::Duration; +/// Backoff is an [`Iterator`] that returns [`Duration`]. +/// +/// - `Some(Duration)` indicates the caller shou...
1
28
6
1c34c4ab28134595a7f10f1e24577af757612a38
Xuanwo
2024-09-04T11:47:30
refactor: Remove the Debug requirement of Backoff (#141) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/backoff/api.rs b/backon/src/backoff/api.rs index 3f8994c..2481618 100644 --- a/backon/src/backoff/api.rs +++ b/backon/src/backoff/api.rs @@ -1,8 +1,7 @@ -use core::fmt::Debug; use core::time::Duration; /// BackoffBuilder is utilized to construct a new backoff. -pub trait BackoffBuilder: Debu...
1
2
3
50ce18569fe94dd3f6d285a8f82c2b0ebce2b1c6
Xuanwo
2024-09-02T05:22:19
Bump to version 1.2.0 (#139) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 110db12..1caf728 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.70" -version = "1.1.0" +version = "1.2.0" edition.workspace = true li...
1
1
1
7ffcbd0714672495e29870a6c30da7051681948d
Xuanwo
2024-08-30T16:45:22
feat: Add blocking sleeper for blocking retry (#138) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index cd7e2fa..e83feb9 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -20,7 +20,8 @@ targets = [ ] [features] -default = ["tokio-sleep", "gloo-timers-sleep"] +default = ["std-blocking-sleep", "tokio-sleep", "gloo-timers-sleep"] +std-blocking-sleep = [] ...
5
169
15
0f6923bd12e81c499bba0a9bcbcc0852c28e0d91
Xuanwo
2024-08-30T16:25:00
docs: Polish MaybeSleeper names (#137) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/retry.rs b/backon/src/retry.rs index 175ccd2..b70e5fc 100644 --- a/backon/src/retry.rs +++ b/backon/src/retry.rs @@ -6,7 +6,7 @@ use std::task::Poll; use std::time::Duration; use crate::backoff::BackoffBuilder; -use crate::sleep::MayBeDefaultSleeper; +use crate::sleep::MaybeSleeper; use cra...
3
33
36
7237d04b652e4cdc5b8f64068ee4b2e1b33681c7
包布丁
2024-08-30T11:12:11
fix: compile to fail when using DefaultSleeper with no features enabled (#136) - Makes compilation to fail when using `DefaultSleeper` with no features enabled. - Should not panic as it is a valid `Sleeper` is guaranteed at compile time. - docs to instruct users to enable a feature or provide custom `Sleeper`. ...
diff --git a/backon/src/lib.rs b/backon/src/lib.rs index 517b9d6..a5434a9 100644 --- a/backon/src/lib.rs +++ b/backon/src/lib.rs @@ -125,7 +125,6 @@ mod sleep; pub use sleep::DefaultSleeper; #[cfg(all(target_arch = "wasm32", feature = "gloo-timers-sleep"))] pub use sleep::GlooTimersSleep; -pub(crate) use sleep::Noop...
4
64
38
40fd96e9e7815033b071e5a6f7da11067f2f9ed2
Xuanwo
2024-08-29T18:06:30
fix: NoopSleeper should implement default (#135) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/src/sleep.rs b/backon/src/sleep.rs index 2cfbf37..ae2abff 100644 --- a/backon/src/sleep.rs +++ b/backon/src/sleep.rs @@ -29,6 +29,7 @@ pub type DefaultSleeper = TokioSleeper; pub type DefaultSleeper = GlooTimersSleep; /// The no-op implementation of `Sleeper` that does nothing. +#[derive(Clone, ...
1
1
0
86298fb950433d1cc35428968f6a5cdaa89b8d47
Xuanwo
2024-08-29T17:46:02
backon: Bump to version 1.1.0 (#133) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 35ead2a..cd7e2fa 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -4,7 +4,7 @@ documentation = "https://docs.rs/backon" name = "backon" readme = "../README.md" rust-version = "1.70" -version = "1.0.2" +version = "1.1.0" edition.workspace = true li...
1
1
1
749740acc50bed14601a7cd3fe125fb6504a1c30
Xuanwo
2024-08-29T17:40:54
refactor: Enable default features to avoid unexpected panic (#132) Most backon users are accustomed to having a default sleep implementation, making it easy for them to upgrade to new versions like `0.5` or `1.0` without the feature enabled. For example: https://github.com/Xuanwo/backon/issues/128 Let's add defa...
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index b70cfd6..35ead2a 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -20,11 +20,12 @@ targets = [ ] [features] +default = ["tokio-sleep", "gloo-timers-sleep"] gloo-timers-sleep = ["dep:gloo-timers", "gloo-timers?/futures"] tokio-sleep = ["dep:tokio", ...
5
33
17
27b54d8fa8fe5dd180cd570bcf3d4259d6d7f0ba
Xuanwo
2024-08-29T15:49:57
docs: Add section for sleeper (#130) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/backon/Cargo.toml b/backon/Cargo.toml index 842758a..b70cfd6 100644 --- a/backon/Cargo.toml +++ b/backon/Cargo.toml @@ -2,6 +2,7 @@ description = "Make retry like a built-in feature provided by Rust." documentation = "https://docs.rs/backon" name = "backon" +readme = "../README.md" rust-version = "1.70...
2
15
1
a046907b719c7db9e3776df8d49e9997b31f6a20
Xuanwo
2024-08-27T03:27:10
docs: Polish display on the first page of lib.rs (#122) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/lib.rs b/src/lib.rs index 6803f25..02cdb3c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! BackON &emsp; [![Build Status]][actions] [![Latest Version]][crates.io] [![](https://img.shields.io/discord/1111711408875393035?logo=discord&label=...
1
1
1
d217a5842633fdae6823d6d31fca90cdccf0ef4b
Xuanwo
2024-08-27T03:23:23
Bump to version 1.0.2 (#120) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index b9535b2..7e97701 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" name = "backon" repository = "https://github.com/Xuanwo/backon" rust-version = "1.70" -version = "1.0.1" +version = "1.0.2" [package.metadata.docs.rs] all-features = true
1
1
1
0af3ab2ac7071d78bda2b9e46dd17d316d7bea03
Xuanwo
2024-08-26T17:46:09
docs: Polish desc of backon (#116) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index b478c6c..b9535b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Retry with backoff without effort." +description = "Make retry like a built-in feature provided by Rust." documentation = "https://docs.rs/backon" edition = "2021" license =...
1
1
1
f2a90624268f0c96a4fd5e5450282877edf51755
Xuanwo
2024-08-26T12:55:44
Bump version to 1.0.1 (#114) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index c15257b..b478c6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" name = "backon" repository = "https://github.com/Xuanwo/backon" rust-version = "1.70" -version = "1.0.0" +version = "1.0.1" [package.metadata.docs.rs] all-features = true
1
1
1
ba6e069fbd53482fd5851ff37c2d2b8371f4ce8a
Xuanwo
2024-08-26T09:49:14
Bump to version 1.0 (#111) Close https://github.com/Xuanwo/backon/issues/90 Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 6156acd..c15257b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" name = "backon" repository = "https://github.com/Xuanwo/backon" rust-version = "1.70" -version = "0.5.0" +version = "1.0.0" [package.metadata.docs.rs] all-features = true
1
1
1
af57964d79ccd4502e48af86448d50938d47f026
Xuanwo
2024-08-23T09:57:02
refactor: Move all backoff in one mod (#103) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/backoff.rs b/src/backoff/api.rs similarity index 100% rename from src/backoff.rs rename to src/backoff/api.rs diff --git a/src/constant.rs b/src/backoff/constant.rs similarity index 98% rename from src/constant.rs rename to src/backoff/constant.rs index b648483..6fa3583 100644 --- a/src/constant.rs +++...
9
24
23
d4301035b1a740e4271a482232347e7c7fb2c16b
Xuanwo
2024-08-23T05:18:14
fix: Expose struct out to generate API docs (#102) Signed-off-by: Xuanwo <github@xuanwo.io> --------- Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/blocking_retry.rs b/src/blocking_retry.rs index 3f229bc..c515dc4 100644 --- a/src/blocking_retry.rs +++ b/src/blocking_retry.rs @@ -57,7 +57,7 @@ where } } -/// Retry struct generated by [`Retryable`]. +/// Retry struct generated by [`BlockingRetryable`]. pub struct BlockingRetry< B: Back...
4
6
3
d292fae77b21ac2584e8e1b22744cba0c272f281
Xuanwo
2024-08-22T11:02:25
Bump to version 0.5.0 (#94) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 0aa6f05..7c72235 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "backon" repository = "https://github.com/Xuanwo/backon" -version = "0.4.4" +version = "0.5.0" [features] gloo-timers-sleep = ["dep:gloo-timers", "gl...
1
1
1
662616967fb68a9a225ca40af9a590745abfd40e
Xuanwo
2024-08-07T10:46:12
feat: Remove dependences on pin_project and futures_core (#86) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 84f53ed..dc283ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,6 @@ version = "0.4.4" [dependencies] fastrand = "2.0.0" -futures-core = "0.3.26" -pin-project = "1" tokio = { version = "1", features = ["time"] } [dev-dependencies] diff --git a/src/retry.rs b/src...
3
75
56
97f24cc51661fe3ded8578789d03529da403f664
Matilda Smeds
2024-05-20T14:00:37
Remove duplicate example, point to examples on docs index page (#84) This PR is based on my own developer experience, of not knowing how to make backon work with an async call that takes variable arguments. To avoid having duplicate examples is various places, we rather point to the documentation index page, wher...
diff --git a/examples/async.rs b/examples/async.rs index 95e9fa0..3690c04 100644 --- a/examples/async.rs +++ b/examples/async.rs @@ -2,6 +2,8 @@ use anyhow::Result; use backon::ExponentialBuilder; use backon::Retryable; +// For more examples, please see: https://docs.rs/backon/#examples + async fn fetch() -> Resul...
4
8
20
7e906602a17c37bbafbd20416b65bbd74266f497
Xuanwo
2024-04-08T03:39:56
Bump backon to 0.4.4 (#81) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index ecf70da..84f53ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "backon" repository = "https://github.com/Xuanwo/backon" -version = "0.4.3" +version = "0.4.4" [dependencies] fastrand = "2.0.0"
1
1
1
53fb6348b562bbb9b8d59553becc1cd9326cefb7
Xuanwo
2024-04-08T03:33:47
feat: Add blocking retry with context support (#80) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/blocking_retry_with_context.rs b/src/blocking_retry_with_context.rs new file mode 100644 index 0000000..40e98ae --- /dev/null +++ b/src/blocking_retry_with_context.rs @@ -0,0 +1,193 @@ +use std::thread; +use std::time::Duration; + +use crate::backoff::BackoffBuilder; +use crate::Backoff; + +/// Blockin...
2
198
2
fe815a87c550e4e8e31474fbe233bd84ee16e340
Xuanwo
2024-03-08T09:25:34
Bump to version 0.4.3 (#74) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index edfb5b7..8bee51b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://docs.rs/backon" edition = "2021" license = "Apache-2.0" name = "backon" -version = "0.4.2" +version = "0.4.3" [dependencies] fastrand = "2.0.0"
1
1
1
2a27ebf6e3d9a837636dc03b368c2b368a38e189
Xuanwo
2024-03-08T09:23:06
docs: Add more examples (#73) Close https://github.com/Xuanwo/backon/issues/67 Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/lib.rs b/src/lib.rs index 8bc147a..0e93d4a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -68,6 +68,92 @@ //! Ok(()) //! } //! ``` +//! +//! Retry functions with args. +//! +//! ```no_run +//! use anyhow::Result; +//! use backon::ExponentialBuilder; +//! use backon::Retryable; +//! +//! async fn fe...
1
86
0
d295d859d496f9193fb4cffd364f3958bcde70a9
Xuanwo
2024-03-08T09:12:08
feat: Add retry with context (#72) Close https://github.com/Xuanwo/backon/issues/49 ```rust use anyhow::anyhow; use anyhow::Result; use backon::ExponentialBuilder; use backon::RetryableWithContext; struct Test; impl Test { async fn hello(&mut self) -> Result<usize> { Err(anyhow!("not retryab...
diff --git a/src/lib.rs b/src/lib.rs index 9c544eb..8bc147a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -95,3 +95,6 @@ pub use retry::Retryable; mod blocking_retry; pub use blocking_retry::BlockingRetry; pub use blocking_retry::BlockingRetryable; + +mod retry_with_context; +pub use retry_with_context::RetryableWithC...
2
373
0
8a6bd0ac64611544ca2f5f557ccac1402880d3b5
yunju.lly
2024-02-27T10:14:24
fix: revise the logic of exponential strategy (#71) 1. fix the bug https://github.com/Xuanwo/backon/issues/38 in exponential strategy 2. revise the logic about 'max_delay is None' scenario Co-authored-by: yunju.lly <lingyun.li@fabarta.com>
diff --git a/src/exponential.rs b/src/exponential.rs index d9d25fd..8e36ab9 100644 --- a/src/exponential.rs +++ b/src/exponential.rs @@ -139,36 +139,40 @@ impl Iterator for ExponentialBackoff { } self.attempts += 1; - match self.current_delay { + let mut tmp_cur = match self.current_de...
1
73
19
a5ba69f4d8a65de5ed1efb20363882e978259683
Xuanwo
2024-02-21T10:45:00
Bump to version 0.4.2 (#69) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index d8e8ae7..edfb5b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://docs.rs/backon" edition = "2021" license = "Apache-2.0" name = "backon" -version = "0.4.1" +version = "0.4.2" [dependencies] fastrand = "2.0.0"
1
1
1
70655779553a898a656d1ed6ccb4f76b12a14938
congyi wang
2024-02-21T10:41:57
fix: fix `with_factor` assert (#68) 💦
diff --git a/src/exponential.rs b/src/exponential.rs index 1d21bd7..d9d25fd 100644 --- a/src/exponential.rs +++ b/src/exponential.rs @@ -71,7 +71,7 @@ impl ExponentialBuilder { /// /// This function will panic if input factor smaller than `1.0`. pub fn with_factor(mut self, factor: f32) -> Self { - ...
1
1
1
b218b373ca1ae9b6abc160e7baf4f7b06ff4176f
Jan Srzednicki
2023-10-27T09:32:14
docs: Document `tokio::time::sleep` usage (#66)
diff --git a/src/lib.rs b/src/lib.rs index c097534..9c544eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,10 @@ //! - [`ExponentialBackoff`]: backoff with exponential delay, also provides jitter supports. //! - [`FibonacciBackoff`]: backoff with fibonacci delay, also provides jitter supports. //! +//! Intern...
1
4
0
f8af1876227836c44faf7e6aaae7bd06def0b1bf
Xuanwo
2023-05-22T16:53:30
fix: Make backon work in wasm (#60) * fix: Make backon work in wasm Signed-off-by: Xuanwo <github@xuanwo.io> * Fix test Signed-off-by: Xuanwo <github@xuanwo.io> --------- Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 1ad6ea3..82c813e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,4 +16,4 @@ tokio = { version = "1", features = ["time"] } [dev-dependencies] anyhow = "1" reqwest = "0.11" -tokio = { version = "1", features = ["full"] } +tokio = { version = "1", features = ["time", "rt", "m...
8
11
12
d7cd205c4f6031b552cad1fc2786c130eccefe5d
Xuanwo
2023-05-19T05:31:42
Bump to version 0.4.1 (#56) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 3ff6d46..1ad6ea3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://docs.rs/backon" edition = "2021" license = "Apache-2.0" name = "backon" -version = "0.4.0" +version = "0.4.1" [dependencies] fastrand = "1.9.0"
1
1
1
dbdc9e388ba3e907313e988cbfe8490addab5e59
Nyuan Zhang
2023-05-19T05:22:29
feat: Allow `FnMut(..)` on `notify` and `when` (#54) * feat: allow notify to use Fn trait * feat: use FnMut, apply to when * chore: remove test for now * feat: remove box * chore: add simple test
diff --git a/src/blocking_retry.rs b/src/blocking_retry.rs index 9f5038f..6141889 100644 --- a/src/blocking_retry.rs +++ b/src/blocking_retry.rs @@ -58,13 +58,19 @@ where } /// Retry struct generated by [`Retryable`]. -pub struct BlockingRetry<B: Backoff, T, E, F: FnMut() -> Result<T, E>> { +pub struct BlockingRetr...
2
133
20
c797e4a5c22c336bfece23594913ef5ef8bb57fb
Shaolong Chen
2023-04-10T15:40:07
feat: impl fibonacci backoff (#53) * feat: impl fibonacci backoff * fix: clippy derivable_impls
diff --git a/src/fibonacci.rs b/src/fibonacci.rs new file mode 100644 index 0000000..74d6ab2 --- /dev/null +++ b/src/fibonacci.rs @@ -0,0 +1,237 @@ +use std::time::Duration; + +use crate::backoff::BackoffBuilder; + +/// FibonacciBuilder is used to build a [`FibonacciBackoff`] +/// +/// # Default +/// +/// - jitter: fal...
3
244
9
0943f0f321da8f1e2812eaab6e594ec35e032364
balroggg
2023-02-25T03:46:19
Add jitter to constant backoff (#47)
diff --git a/Cargo.toml b/Cargo.toml index b2e54ef..3ff6d46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,9 +8,9 @@ name = "backon" version = "0.4.0" [dependencies] -futures = "0.3" +fastrand = "1.9.0" +futures-core = "0.3.26" pin-project = "1" -rand = "0.8" tokio = { version = "1", features = ["time"] } [dev...
4
31
13
9f969648f77fe5fc2defdda408cf8ef681169830
balroggg
2023-02-23T00:09:17
Add closure example (#46)
diff --git a/examples/closure.rs b/examples/closure.rs new file mode 100644 index 0000000..fbfcd3a --- /dev/null +++ b/examples/closure.rs @@ -0,0 +1,13 @@ +use anyhow::Result; +use backon::BlockingRetryable; +use backon::ExponentialBuilder; + +fn main() -> Result<()> { + let var = 42; + // `f` can use input vari...
1
13
0
e1d25dfb01e7fc761405264c6c2299fbdf1c3997
balroggg
2023-02-22T03:11:19
Add examples (#45)
diff --git a/examples/async.rs b/examples/async.rs new file mode 100644 index 0000000..8f05515 --- /dev/null +++ b/examples/async.rs @@ -0,0 +1,21 @@ +use anyhow::Result; +use backon::ExponentialBuilder; +use backon::Retryable; + +async fn fetch() -> Result<String> { + let response = reqwest::get("https://httpbingo....
2
35
0
691f3616f8f90acf0fe94640d6fbed4cca6fb2d8
Xuanwo
2023-02-08T07:52:00
Bump to version 0.4 (#34) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 6d958b8..b2e54ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://docs.rs/backon" edition = "2021" license = "Apache-2.0" name = "backon" -version = "0.3.1" +version = "0.4.0" [dependencies] futures = "0.3"
1
1
1
fd445ba4a109903cd3353dbea2c57215cdf94bba
Xuanwo
2023-02-08T07:40:44
refactor: Retryable should accept a reference (#33) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/blocking_retry.rs b/src/blocking_retry.rs index a08fac1..9f5038f 100644 --- a/src/blocking_retry.rs +++ b/src/blocking_retry.rs @@ -36,7 +36,7 @@ use crate::Backoff; /// } /// /// fn main() -> Result<()> { -/// let content = fetch.retry(ExponentialBuilder::default()).call()?; +/// let conten...
5
20
20
5bc8c6e491fe0143e729a6299e8d68e3723126e2
Xuanwo
2023-02-08T07:16:15
feat: Allow clone on backoff builder (#30) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/backoff.rs b/src/backoff.rs index e16a63f..2a34abc 100644 --- a/src/backoff.rs +++ b/src/backoff.rs @@ -2,7 +2,7 @@ use std::fmt::Debug; use std::time::Duration; /// BackoffBuilder is used to build a new backoff. -pub trait BackoffBuilder: Default + Debug + Send + Sync + Unpin { +pub trait BackoffB...
3
3
3
7759072fb94b014028c5b32b37462bcc06f6f96b
Xuanwo
2023-02-08T03:02:38
feat: Add more trait bound for backoff trait (#26) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/backoff.rs b/src/backoff.rs index 353f453..b14c5b5 100644 --- a/src/backoff.rs +++ b/src/backoff.rs @@ -1,8 +1,9 @@ +use std::fmt::Debug; use std::time::Duration; /// Backoff is an [`Iterator`] that returns [`Duration`]. /// /// - `Some(Duration)` means caller need to `sleep(Duration)` and retry ...
3
5
4
1c892ab37b1e0e22179419c0cca5bad46e29603d
Xuanwo
2022-09-17T02:55:36
Bump to version 0.2 (#20) Signed-off-by: Xuanwo <github@xuanwo.io> Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index dd8054e..9af1821 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://docs.rs/backon" edition = "2021" license = "Apache-2.0" name = "backon" -version = "0.1.0" +version = "0.2.0" [dependencies] futures = "0.3"
1
1
1
7d0c19200a41036a92c3ac3e4d2ac8073a3011a8
Xuanwo
2022-09-17T02:50:42
feat: Implement notify support (#19) Signed-off-by: Xuanwo <github@xuanwo.io> Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/constant.rs b/src/constant.rs index 58f410c..5137b92 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -10,12 +10,15 @@ use std::time::Duration; /// # Examples /// /// ```no_run -/// use backon::Retryable; -/// use backon::ConstantBackoff; /// use anyhow::Result; +/// use backon::ConstantBackof...
4
88
25
18f5f3c2871966bdf66dfb93917e760a8540b65f
Xuanwo
2022-09-17T02:34:41
refactor: Remove deprecated functions (#18) Signed-off-by: Xuanwo <github@xuanwo.io> Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/src/retry.rs b/src/retry.rs index eeb712d..fbfae5d 100644 --- a/src/retry.rs +++ b/src/retry.rs @@ -121,38 +121,7 @@ where /// Set the conditions for retrying. /// - /// If not specifed, we treat all errors as retryable. - /// - /// # Examples - /// - /// ```no_run - /// use b...
1
1
32
d0317cfc77cfee926f26801637951b939a192f8d
Wenxuan
2022-07-04T15:28:43
refactor: rename `with_error_fn` into `when` (#15)
diff --git a/src/lib.rs b/src/lib.rs index 0f0c4ee..291e302 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,7 +50,7 @@ //! async fn main() -> Result<()> { //! let content = fetch //! .retry(ExponentialBackoff::default()) -//! .with_error_fn(|e| e.to_string() == "retryable").await?; +//! ....
2
41
8
7dba82dc4dd2ea7f4d65350f605a8f4a56214a96
Xuanwo
2022-04-14T07:23:31
Bump to version 0.0.2 (#8) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 3c439ff..bc3230c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://docs.rs/backon" edition = "2021" license = "Apache-2.0" name = "backon" -version = "0.0.1" +version = "0.0.2" [dependencies] futures = "0.3.21"
1
1
1
3fc925b07c73f8a0fc18f963459fc356fe803ceb
Xuanwo
2022-04-14T06:44:01
Bump to version 0.0.1 (#5) Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 8416d3f..27c3aa5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://docs.rs/backon" edition = "2021" license = "Apache-2.0" name = "backon" -version = "0.0.0" +version = "0.0.1" [dependencies] futures = "0.3.21"
1
1
1
d662c9214678cbff3cca8b99a5d5ebea3c724d02
Xuanwo
2022-04-12T11:42:51
feat: Implement Constant and Exponential backoff Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/Cargo.toml b/Cargo.toml index 899c4c6..314b5c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,3 +8,4 @@ documentation = "https://docs.rs/backon" description = "Backoff policies" [dependencies] +rand = "0.8.5" diff --git a/src/constant.rs b/src/constant.rs new file mode 100644 index 0000000..47657cf ---...
5
270
8
f43cabeac8b42a62582f74162eebaa55e71333fc
Austin Bonander
2019-10-22T03:54:06
bump patch version 0.3.3
diff --git a/Cargo.toml b/Cargo.toml index 1ebacc5..d9eea09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safemem" -version = "0.3.2" +version = "0.3.3" authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::pt...
1
1
1
365158b658baa6b0f71ad15b0c00838ee32b56ba
Austin Bonander
2019-10-22T01:36:22
bump patch version 0.3.2
diff --git a/Cargo.toml b/Cargo.toml index 0c686c0..1ebacc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safemem" -version = "0.3.1" +version = "0.3.2" authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::pt...
1
1
1
52210cc62896ef2c2ee55d53bcf5ed77a33fdf17
danielhenrymantilla
2019-10-21T11:52:29
Fix MSRV compatibility
diff --git a/src/lib.rs b/src/lib.rs index b3b7ecd..bae1ae1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -77,7 +77,7 @@ pub fn prepend<T: Copy>(elems: &[T], vec: &mut Vec<T>) { } else { // Our overflow check occurs here, no need to do it ourselves. vec.reserve(elems_len); - let ptr = Vec::a...
1
1
1
87ec10ba52410c05942ace4850519e7faaedad5f
Konrad Borowski
2019-08-14T16:28:56
Use offset instead of add This ensures compatibility with older Rust releases. Fixes marshallpierce/rust-base64#112.
diff --git a/src/lib.rs b/src/lib.rs index 09245c9..1a48f9b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,7 +44,7 @@ pub fn copy_over<T: Copy>(slice: &mut [T], src_idx: usize, dest_idx: usize, len: let ptr = slice.as_mut_ptr(); unsafe { - ptr::copy(ptr.add(src_idx), ptr.add(dest_idx), len); + ...
1
1
2
485a39bfe8fa26cd020df97f744a628138b6e3d4
Austin Bonander
2019-07-30T19:59:16
bump version
diff --git a/Cargo.toml b/Cargo.toml index 131ac41..0c686c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safemem" -version = "0.3.0" +version = "0.3.1" authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::pt...
1
1
1
219a2731cab0fed45f001796c601e3026f15c5a6
Konrad Borowski
2019-07-30T11:55:13
Remove UB in copy_over method With current memory model, &mut in dest_ptr assignment invalidated src_ptr (this can be seen in miri). This commit avoids this issue by performing operations on pointers instead, avoiding reference indirection that requires exclusivity.
diff --git a/src/lib.rs b/src/lib.rs index d115136..09245c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,11 +41,10 @@ pub fn copy_over<T: Copy>(slice: &mut [T], src_idx: usize, dest_idx: usize, len: len_check!(slice, src_idx, len); len_check!(slice, dest_idx, len); - let src_ptr: *const T = &slice[src...
1
2
3
56b5eabcc3403c60c66ece1730e7fae5a28e4019
Austin Bonander
2018-04-17T08:18:42
bump version to 0.3.0
diff --git a/Cargo.toml b/Cargo.toml index 6147066..131ac41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safemem" -version = "0.2.0" +version = "0.3.0" authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::pt...
1
1
1
9b4cf4724206b036fc86eb723c800b04e5ff52c7
Evgeniy Reizner
2017-11-16T08:01:10
Fixed 'license' field According to [Cargo manifest](http://doc.crates.io/manifest.html): >Multiple licenses can be separated with a `/`.
diff --git a/Cargo.toml b/Cargo.toml index 061b502..e6786b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::ptr::copy()`." repository = "https://github.com/abonander/safemem" key...
1
1
1
075fae968101e119f8a05199e28868e190638092
Austin Bonander
2016-12-14T05:48:49
`copy()` -> `copy_over()`, add `prepend()` and tests
diff --git a/Cargo.toml b/Cargo.toml index ac4f92b..061b502 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safemem" -version = "0.1.1" +version = "0.2.0" authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::pt...
2
59
9
57fd44c4a28535510662e6d54e04b1f6c70079bf
Austin Bonander
2016-11-21T12:43:28
Fix typo
diff --git a/src/lib.rs b/src/lib.rs index 4c2a3f7..849a5bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,7 @@ macro_rules! len_check ( ($slice:expr, $start:ident, $len:ident) => { assert!( $start.checked_add($len) - .expect(concat!("Overflow evaluating ", strigify!($st...
1
1
1
61c42bcd8bb26a0edae13f3832a8bd3f24c6c4e3
Austin Bonander
2016-11-21T12:42:52
Bump version, add docs link
diff --git a/Cargo.toml b/Cargo.toml index 91cda7f..ac4f92b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safemem" -version = "0.1.0" +version = "0.1.1" authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::pt...
1
3
1
1dc8e0bf6753fc613e6f266f533583fb4c699c46
Austin Bonander
2016-11-21T12:42:41
Fix bounds-checking for indexes vs lengths, clarify behavior
diff --git a/src/lib.rs b/src/lib.rs index 44998c9..4c2a3f7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ //! Safe wrappers for memory-accessing functions like `std::ptr::copy()`. use std::ptr; -macro_rules! bounds_check ( +macro_rules! idx_check ( ($slice:expr, $idx:expr) => { assert!($idx...
1
18
8
e2e9e81346d6c43f783bc0fa5e7786a07d25ebe7
Austin Bonander
2016-09-10T02:34:34
Fixup license
diff --git a/Cargo.toml b/Cargo.toml index ad7413e..91cda7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,6 @@ authors = ["Austin Bonander <austin.bonander@gmail.com>"] description = "Safe wrappers for memory-accessing functions, like `std::ptr::copy()`." repository = "https://github.com/abonander/safemem" key...
1
1
1
90f3d09696f7c08dcac94ca2bb2a279383bb20ce
Dan Gohman
2025-09-09T20:13:01
Add an entry for .cda (#98) ".cda" corresponding to "application/x-cdf" is listed in [MDN's "Common media types" page]. By my count, it is the only entry on that page not yet covered in the mime_guess crate. It is not in IANA. It is in [Debian's media-types]. [MDN's "Common media types" page]: https://developer.mozi...
diff --git a/src/mime_types.rs b/src/mime_types.rs index a9b5e6e..e5791aa 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -160,6 +160,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("cct", &["application/x-director"]), ("ccxml", &["application/ccxml+xml"]), ("cd", &["text/plain"]), + ("...
1
1
0
98842a70850d9808ebb88e5d96f95e885991021d
David Tolnay
2025-09-09T20:12:23
Support running build script and compilation on different machines (#96)
diff --git a/build.rs b/build.rs index 89b94ae..1458398 100644 --- a/build.rs +++ b/build.rs @@ -8,7 +8,7 @@ use std::env; use std::fs::File; use std::io::prelude::*; use std::io::BufWriter; -use std::path::Path; +use std::path::{self, Path}; use std::collections::BTreeMap; @@ -22,12 +22,14 @@ const PHF_PATH: &...
3
8
6
b25a55689a4335841d84dfc38cd54f438a6b2b50
Enduriel
2025-09-09T20:05:40
feat: add support for QOI files (#101)
diff --git a/src/mime_types.rs b/src/mime_types.rs index 08620e6..a9b5e6e 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -1003,6 +1003,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("qfx", &["application/vnd.intu.qfx"]), ("qht", &["text/x-html-insertion"]), ("qhtm", &["text/x-html-insert...
1
1
0
d019881531d3a1aa7060e633e0ff70981f43df74
Paolo Barbolini
2025-04-17T04:35:33
build: fix -Zminimal-versions build (#92)
diff --git a/Cargo.toml b/Cargo.toml index fec4597..1da24e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ default = ["rev-mappings"] rev-mappings = [] [dependencies] -mime = "0.3" +mime = "0.3.4" unicase = "2.4.0" #[dependencies.phf]
1
1
1
ae84cb01171b3a41bf0fc05ce764f6ddd3d917ef
Paolo Barbolini
2025-04-17T04:35:16
Update mime type of `.woff` files (#95) If you seach for "woff" within [1] you'll find that `application/font-woff` has been deprecated and replaced with `font/woff`. [1]: https://www.iana.org/assignments/media-types/media-types.xhtml
diff --git a/src/mime_types.rs b/src/mime_types.rs index e79ac52..08620e6 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -1408,7 +1408,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("wmv", &["video/x-ms-wmv"]), ("wmx", &["video/x-ms-wmx"]), ("wmz", &["application/x-ms-wmz"]), - ("woff...
1
1
1
5b94c929e51a447c07ad64358f77e8ab848dd83b
Jérémie Ferry
2025-04-11T08:07:59
Add support for xcf file type (gimp format) (#94)
diff --git a/src/mime_types.rs b/src/mime_types.rs index ab4ca6f..e79ac52 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -1438,6 +1438,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("xbap", &["application/x-ms-xbap"]), ("xbd", &["application/vnd.fujixerox.docuworks.binder"]), ("xbm", &["...
1
1
0
805964fb54871f0154ee155bf21729b77ffd4a1c
Austin Bonander
2024-06-29T07:27:23
chore: bump version to 2.0.5
diff --git a/Cargo.toml b/Cargo.toml index 7ca2b13..fec4597 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" authors = ["Austin Bonander <austin.bonander@gmail.com>"] license = "MIT" description = "A simple crate for detection of a file'...
1
1
1
31f67c382023b4158dc456b348e0138ead931724
Sean Lynch
2024-06-29T07:14:16
Add new mime type entry for .parquet (#91) The application/vnd.apache.parquet mime type was recently registered with IANA: https://www.iana.org/assignments/media-types/application/vnd.apache.parquet This also includes the deprecated application/x-parquet mime type in the list as it was mentioned on the media typ...
diff --git a/src/mime_types.rs b/src/mime_types.rs index 0ba73d0..ab4ca6f 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -886,6 +886,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("p7s", &["application/pkcs7-signature"]), ("p8", &["application/pkcs8"]), ("pac", &["application/x-ns-proxy-...
1
1
0
920feb428b82309922c162ea5dd62e644a0e0f16
Tạ Quan Minh Long
2024-06-29T07:13:53
Add support for application `application/x-gzip`, equivalent of `application/gzip` since some servers still use this type of content-type header (#89) reference: https://stackoverflow.com/questions/21870351/difference-between-x-gzip-and-gzip-for-content-encoding https://mimetype.io/application/x-gzip
diff --git a/src/mime_types.rs b/src/mime_types.rs index a31d441..0ba73d0 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -450,7 +450,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("gv", &["text/vnd.graphviz"]), ("gxf", &["application/gxf"]), ("gxt", &["application/vnd.geonext"]), - ("...
1
1
1
aac5aa7fe8e82ba9591e0ec692627f2d65f44f05
Matej Knopp
2024-06-29T07:12:10
mimetypes: add image/heic, image/heif and image/jxl (#82) https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format https://en.wikipedia.org/wiki/JPEG_XL Co-authored-by: Austin Bonander <austin@launchbadge.com>
diff --git a/src/mime_types.rs b/src/mime_types.rs index 4fb3f39..a31d441 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -104,6 +104,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("au", &["audio/basic"]), ("avi", &["video/x-msvideo"]), ("avif", &["image/avif"]), + ("avifs", &["image/a...
1
6
0
5286da2df9da69b5cbdca1041f83a6dc026a9e74
Hubert Figuière
2024-06-29T07:11:15
Added most of the image/x-dcraw extensions (#81) - https://github.com/freedesktop/xdg-shared-mime-info/blob/master/data/freedesktop.org.xml.in - Compared with the output of `gio info` Co-authored-by: Austin Bonander <austin@launchbadge.com>
diff --git a/src/mime_types.rs b/src/mime_types.rs index c7156f9..4fb3f39 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -81,6 +81,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("arc", &["application/x-freearc"]), ("arj", &["application/x-arj"]), ("art", &["image/x-jg"]), + ("arw", &[...
1
30
2
1ae11679916b18fcced93c11104b7aed53bd35a2
Christoph FRITZ
2023-11-30T15:41:11
refactor: update ECMA script types Some ECMA script mime types were obsoleted in favor of 'text/javascript'. For a full reference check RFC 9239 (https://www.ietf.org/rfc/rfc9239.pdf).
diff --git a/src/mime_types.rs b/src/mime_types.rs index b6215ad..c7156f9 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -315,7 +315,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("ecelp4800", &["audio/vnd.nuera.ecelp4800"]), ("ecelp7470", &["audio/vnd.nuera.ecelp7470"]), ("ecelp9600", &...
1
5
5
985fc5d38c511599dca0407ec585774d1d76db7b
Christoph FRITZ
2023-11-30T15:56:01
refactor: use correct MIME type for ics Instead of using the default application/octet-stream mime type for ics format use the appropriate text/calendar mime type according to RFC 2445 (https://www.ietf.org/rfc/rfc2445.txt).
diff --git a/src/mime_types.rs b/src/mime_types.rs index 6c608c7..b6215ad 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -490,7 +490,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("ice", &["x-conference/x-cooltalk"]), ("icm", &["application/vnd.iccprofile"]), ("ico", &["image/x-icon"]), ...
1
1
1
fa5759c1bed87abea7af341ab2e50f51b0599326
NathanW
2022-09-14T23:04:22
Use platform specific path separators Problem: - When `include!(..)`ing the `mime_types_generated` file, it was assumed that the separator was `/`. However, this will occasionally break on windows causing a compile error. Solution - From the build script, embed the file path into a compile-time `env!` which use...
diff --git a/build.rs b/build.rs index ff4ea76..89b94ae 100644 --- a/build.rs +++ b/build.rs @@ -23,7 +23,12 @@ const PHF_PATH: &str = "::impl_::phf"; fn main() { let out_dir = env::var("OUT_DIR").unwrap(); let dest_path = Path::new(&out_dir).join("mime_types_generated.rs"); - let mut outfile = BufWriter:...
3
8
3
f6d36d8531bef9ad86f3ee274f65a1a31ea4d9b4
devsnek
2022-03-01T19:22:32
update entry for `jfif` It would seem that `image/pjpeg` is a weird thing invented by IE. I have been unable to find any references to it outside of that context (for example, in any RFC). Additionally, JFIF (jpeg file interchange format) does not imply progressive encoding, so I don't think this is correct anyway.
diff --git a/src/mime_types.rs b/src/mime_types.rs index 13c91b7..6c608c7 100644 --- a/src/mime_types.rs +++ b/src/mime_types.rs @@ -542,7 +542,7 @@ pub static MIME_TYPES: &[(&str, &[&str])] = &[ ("java", &["application/octet-stream"]), ("jck", &["application/liquidmotion"]), ("jcz", &["application/liqui...
1
1
1
7636693a3a721ecf4023326aca871bd69ec08d9d
Austin Bonander
2022-02-16T21:53:10
bump version
diff --git a/Cargo.toml b/Cargo.toml index 30b74d4..7ca2b13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mime_guess" -version = "2.0.3" +version = "2.0.4" authors = ["Austin Bonander <austin.bonander@gmail.com>"] license = "MIT" description = "A simple crate for detection of a file'...
1
1
1