Files
continuwuity/src/core/utils/mod.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
912 B
Rust
Raw Normal View History

2024-07-03 00:54:36 +00:00
pub mod bytes;
2024-05-27 20:05:33 +00:00
pub mod content_disposition;
pub mod debug;
pub mod defer;
2024-06-04 23:51:02 +00:00
pub mod hash;
2024-05-27 20:05:33 +00:00
pub mod html;
pub mod json;
pub mod math;
2024-06-14 21:11:31 +00:00
pub mod mutex_map;
2024-07-03 08:44:59 +00:00
pub mod rand;
2024-08-08 17:18:30 +00:00
pub mod set;
pub mod stream;
2024-07-03 00:47:58 +00:00
pub mod string;
2024-05-27 20:05:33 +00:00
pub mod sys;
2024-06-25 01:31:52 +00:00
mod tests;
2024-07-03 00:57:50 +00:00
pub mod time;
2024-05-27 20:05:33 +00:00
2024-08-08 17:18:30 +00:00
pub use ::conduit_macros::implement;
2024-07-24 23:01:00 +00:00
pub use ::ctor::{ctor, dtor};
2024-08-08 17:18:30 +00:00
pub use self::{
bytes::{increment, u64_from_bytes, u64_from_u8, u64_from_u8x8},
debug::slice_truncated as debug_slice_truncated,
hash::calculate_hash,
html::Escape as HtmlEscape,
json::{deserialize_from_str, to_canonical_object},
math::clamp,
mutex_map::{Guard as MutexMapGuard, MutexMap},
rand::string as random_string,
stream::{IterStream, ReadyExt, TryReadyExt},
string::{str_from_bytes, string_from_bytes},
sys::available_parallelism,
time::now_millis as millis_since_unix_epoch,
};
2024-05-09 15:59:08 -07:00
2024-07-23 06:57:14 +00:00
#[inline]
pub fn exchange<T>(state: &mut T, source: T) -> T { std::mem::replace(state, source) }