veilid/veilid-core/src/xx/mod.rs

116 lines
3.7 KiB
Rust
Raw Normal View History

2021-11-22 16:28:30 +00:00
// mod bump_port;
2022-01-05 17:01:02 +00:00
mod async_peek_stream;
2022-10-02 22:47:36 +00:00
mod async_tag_lock;
2022-01-05 17:01:02 +00:00
mod clone_stream;
2021-11-22 16:28:30 +00:00
mod eventual;
mod eventual_base;
mod eventual_value;
mod eventual_value_clone;
mod ip_addr_port;
mod ip_extra;
2021-12-17 02:57:28 +00:00
mod log_thru;
2022-06-13 00:58:02 +00:00
mod must_join_handle;
mod must_join_single_future;
2022-06-05 00:18:26 +00:00
mod mutable_future;
2022-07-14 20:57:34 +00:00
mod network_result;
2021-11-22 16:28:30 +00:00
mod single_shot_eventual;
mod split_url;
2021-11-22 16:28:30 +00:00
mod tick_task;
2022-07-10 21:36:50 +00:00
mod timeout_or;
2021-11-22 16:28:30 +00:00
mod tools;
pub use cfg_if::*;
2022-07-10 21:36:50 +00:00
#[allow(unused_imports)]
pub use eyre::{bail, ensure, eyre, Report as EyreReport, Result as EyreResult, WrapErr};
2022-05-31 23:54:52 +00:00
pub use futures_util::future::{select, Either};
pub use futures_util::select;
pub use futures_util::stream::FuturesUnordered;
pub use futures_util::{AsyncRead, AsyncWrite};
2021-12-17 02:57:28 +00:00
pub use log_thru::*;
2022-05-31 23:54:52 +00:00
pub use owo_colors::OwoColorize;
2021-11-22 16:28:30 +00:00
pub use parking_lot::*;
pub use split_url::*;
2021-11-22 16:28:30 +00:00
pub use static_assertions::*;
2022-06-13 00:58:02 +00:00
pub use stop_token::*;
2022-07-10 21:36:50 +00:00
pub use thiserror::Error as ThisError;
2022-06-08 01:31:05 +00:00
pub use tracing::*;
2021-11-22 16:28:30 +00:00
pub type PinBox<T> = Pin<Box<T>>;
pub type PinBoxFuture<T> = PinBox<dyn Future<Output = T> + 'static>;
pub type PinBoxFutureLifetime<'a, T> = PinBox<dyn Future<Output = T> + 'a>;
pub type SendPinBoxFuture<T> = PinBox<dyn Future<Output = T> + Send + 'static>;
pub type SendPinBoxFutureLifetime<'a, T> = PinBox<dyn Future<Output = T> + Send + 'a>;
2022-11-06 21:07:56 +00:00
pub use std::borrow::{Cow, ToOwned};
pub use std::boxed::Box;
pub use std::cell::RefCell;
pub use std::cmp;
pub use std::collections::btree_map::BTreeMap;
pub use std::collections::btree_set::BTreeSet;
pub use std::collections::hash_map::HashMap;
pub use std::collections::hash_set::HashSet;
pub use std::collections::LinkedList;
pub use std::collections::VecDeque;
pub use std::convert::{TryFrom, TryInto};
pub use std::fmt;
pub use std::future::Future;
pub use std::mem;
2022-11-26 19:16:02 +00:00
pub use std::net::{
IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs,
};
2022-11-06 21:07:56 +00:00
pub use std::ops::{Fn, FnMut, FnOnce};
pub use std::pin::Pin;
pub use std::rc::Rc;
pub use std::string::String;
pub use std::sync::atomic::{AtomicBool, Ordering};
pub use std::sync::{Arc, Weak};
pub use std::task;
pub use std::time::Duration;
pub use std::vec::Vec;
2021-11-22 16:28:30 +00:00
cfg_if! {
if #[cfg(target_arch = "wasm32")] {
pub use wasm_bindgen::prelude::*;
2022-11-06 21:07:56 +00:00
2022-01-04 04:58:26 +00:00
pub use async_lock::Mutex as AsyncMutex;
pub use async_lock::MutexGuard as AsyncMutexGuard;
2022-10-02 22:47:36 +00:00
pub use async_lock::MutexGuardArc as AsyncMutexGuardArc;
2022-06-28 03:46:29 +00:00
pub use async_executors::JoinHandle as LowLevelJoinHandle;
2021-11-22 16:28:30 +00:00
} else {
2022-06-28 03:46:29 +00:00
cfg_if! {
if #[cfg(feature="rt-async-std")] {
pub use async_std::sync::Mutex as AsyncMutex;
pub use async_std::sync::MutexGuard as AsyncMutexGuard;
2022-10-02 22:47:36 +00:00
pub use async_std::sync::MutexGuardArc as AsyncMutexGuardArc;
2022-06-28 03:46:29 +00:00
pub use async_std::task::JoinHandle as LowLevelJoinHandle;
} else if #[cfg(feature="rt-tokio")] {
pub use tokio::sync::Mutex as AsyncMutex;
pub use tokio::sync::MutexGuard as AsyncMutexGuard;
2022-10-02 22:47:36 +00:00
pub use tokio::sync::OwnedMutexGuard as AsyncMutexGuardArc;
2022-06-28 03:46:29 +00:00
pub use tokio::task::JoinHandle as LowLevelJoinHandle;
2022-08-22 17:27:26 +00:00
} else {
#[compile_error("must use an executor")]
2022-06-28 03:46:29 +00:00
}
}
2021-11-22 16:28:30 +00:00
}
}
// pub use bump_port::*;
2022-01-05 17:01:02 +00:00
pub use async_peek_stream::*;
2022-10-02 22:47:36 +00:00
pub use async_tag_lock::*;
2022-01-05 17:01:02 +00:00
pub use clone_stream::*;
2021-11-22 16:28:30 +00:00
pub use eventual::*;
pub use eventual_base::{EventualCommon, EventualResolvedFuture};
pub use eventual_value::*;
pub use eventual_value_clone::*;
pub use ip_addr_port::*;
pub use ip_extra::*;
2022-06-13 00:58:02 +00:00
pub use must_join_handle::*;
pub use must_join_single_future::*;
2022-06-05 00:18:26 +00:00
pub use mutable_future::*;
2022-07-14 20:57:34 +00:00
pub use network_result::*;
2021-11-22 16:28:30 +00:00
pub use single_shot_eventual::*;
pub use tick_task::*;
2022-07-10 21:36:50 +00:00
pub use timeout_or::*;
2021-11-22 16:28:30 +00:00
pub use tools::*;