Debian Codegraph @

src/lib.rs

raw symbols SCIP
1 //! A crate with utilities that don't need feature toggles.
2 //!
3 //! If they would need feature toggles, they should be in `gix-features` instead.
4 //!
5 //! ## Examples
6 //!
7 //! ```
8 //! use std::time::Duration;
9 //!
10 //! use gix_utils::{backoff::Quadratic};
11 //!
12 //! let waits: Vec<_> = Quadratic::default().take(3).collect();
13 //! assert_eq!(waits, vec![
14 //! Duration::from_millis(1),
15 //! Duration::from_millis(4),
16 //! Duration::from_millis(9),
17 //! ]);
18 //! ```
19 #![deny(missing_docs)]
20 #![forbid(unsafe_code)]
21
22 ///
23 pub mod backoffrust-analyzer cargo gix-utils 0.3.5 backoff/;
24
25 ///
26 pub mod rngrust-analyzer cargo gix-utils 0.3.5 rng/;
27
28 ///
29 pub mod buffersrust-analyzer cargo gix-utils 0.3.5 buffers/;
30
31 ///
32 pub mod strrust-analyzer cargo gix-utils 0.3.5 str/;
33
34 ///
35 pub mod btoirust-analyzer cargo gix-utils 0.3.5 btoi/;
36
37 /// Byte-string conversion utilities.
38 #[cfg(feature = "bstr")]
39 mod bstrrust-analyzer cargo gix-utils 0.3.5 bstr/;
40 #[cfg(feature = "bstr")]
41 pub use bstrrust-analyzer cargo gix-utils 0.3.5 bstr/::{AsBStrrust-analyzer cargo gix-utils 0.3.5 bstr/AsBStr#, AsBStrOptrust-analyzer cargo gix-utils 0.3.5 bstr/AsBStrOpt#};
42
43 /// A utility to do buffer-swapping with.
44 ///
45 /// Use `src` to read from and `dest` to write to, and after actually changing data, call [Buffers::swap()].
46 /// To be able to repeat the process, this time using what was `dest` as `src`, freeing up `dest` for writing once more.
47 ///
48 /// Note that after each [`Buffers::swap()`], `src` is the most recent version of the data, just like before each swap.
49 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)]
50 pub struct Buffersrust-analyzer cargo gix-utils 0.3.5 Buffers# {
51 /// The source data, as basis for processing.
52 pub srcrust-analyzer cargo gix-utils 0.3.5 Buffers#src.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>,
53 /// The data produced after processing `src`.
54 pub destrust-analyzer cargo gix-utils 0.3.5 Buffers#dest.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>,
55 }