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

118 lines
4.2 KiB
Rust
Raw Normal View History

2021-11-22 11:28:30 -05:00
// mod bump_port;
2022-01-05 12:01:02 -05:00
mod async_peek_stream;
mod clone_stream;
2021-11-22 11:28:30 -05:00
mod eventual;
mod eventual_base;
mod eventual_value;
mod eventual_value_clone;
mod ip_addr_port;
mod ip_extra;
2021-12-16 21:57:28 -05:00
mod log_thru;
2022-06-12 20:58:02 -04:00
mod must_join_handle;
mod must_join_single_future;
2022-06-04 20:18:26 -04:00
mod mutable_future;
2021-11-22 11:28:30 -05:00
mod single_future;
mod single_shot_eventual;
mod split_url;
2021-11-22 11:28:30 -05:00
mod tick_task;
mod tools;
pub use cfg_if::*;
2022-05-31 19:54:52 -04: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-16 21:57:28 -05:00
pub use log_thru::*;
2022-05-31 19:54:52 -04:00
pub use owo_colors::OwoColorize;
2021-11-22 11:28:30 -05:00
pub use parking_lot::*;
pub use split_url::*;
2021-11-22 11:28:30 -05:00
pub use static_assertions::*;
2022-06-12 20:58:02 -04:00
pub use stop_token::*;
2022-06-07 21:31:05 -04:00
pub use tracing::*;
2021-11-22 11:28:30 -05: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>;
cfg_if! {
if #[cfg(target_arch = "wasm32")] {
pub use alloc::string::String;
pub use alloc::vec::Vec;
2022-03-19 18:19:40 -04:00
pub use alloc::collections::LinkedList;
pub use alloc::collections::VecDeque;
2021-11-22 11:28:30 -05:00
pub use alloc::collections::btree_map::BTreeMap;
pub use alloc::collections::btree_set::BTreeSet;
2022-03-19 18:19:40 -04:00
pub use hashbrown::hash_map::HashMap;
pub use hashbrown::hash_set::HashSet;
2021-11-22 11:28:30 -05:00
pub use alloc::boxed::Box;
pub use alloc::borrow::{Cow, ToOwned};
pub use wasm_bindgen::prelude::*;
pub use core::cmp;
2022-05-31 19:54:52 -04:00
pub use core::convert::{TryFrom, TryInto};
2021-11-22 11:28:30 -05:00
pub use core::mem;
2022-05-31 19:54:52 -04:00
pub use core::fmt;
2021-11-22 11:28:30 -05:00
pub use alloc::rc::Rc;
pub use core::cell::RefCell;
pub use core::task;
pub use core::future::Future;
2022-05-31 19:54:52 -04:00
pub use core::time::Duration;
2021-11-22 11:28:30 -05:00
pub use core::pin::Pin;
pub use core::sync::atomic::{Ordering, AtomicBool};
pub use alloc::sync::{Arc, Weak};
pub use core::ops::{FnOnce, FnMut, Fn};
2022-01-03 23:58:26 -05:00
pub use async_lock::Mutex as AsyncMutex;
pub use async_lock::MutexGuard as AsyncMutexGuard;
2021-11-22 11:28:30 -05:00
pub use no_std_net::{ SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs, IpAddr, Ipv4Addr, Ipv6Addr };
pub type SystemPinBoxFuture<T> = PinBox<dyn Future<Output = T> + 'static>;
pub type SystemPinBoxFutureLifetime<'a, T> = PinBox<dyn Future<Output = T> + 'a>;
} else {
pub use std::string::String;
pub use std::vec::Vec;
2022-03-19 18:19:40 -04:00
pub use std::collections::LinkedList;
pub use std::collections::VecDeque;
2021-11-22 11:28:30 -05:00
pub use std::collections::btree_map::BTreeMap;
pub use std::collections::btree_set::BTreeSet;
2022-03-19 18:19:40 -04:00
pub use std::collections::hash_map::HashMap;
pub use std::collections::hash_set::HashSet;
2021-11-22 11:28:30 -05:00
pub use std::boxed::Box;
pub use std::borrow::{Cow, ToOwned};
pub use std::cmp;
2022-05-31 19:54:52 -04:00
pub use std::convert::{TryFrom, TryInto};
2021-11-22 11:28:30 -05:00
pub use std::mem;
2022-05-31 19:54:52 -04:00
pub use std::fmt;
2021-11-22 11:28:30 -05:00
pub use std::sync::atomic::{Ordering, AtomicBool};
pub use std::sync::{Arc, Weak};
pub use std::rc::Rc;
pub use std::cell::RefCell;
pub use std::task;
2022-05-31 19:54:52 -04:00
pub use std::future::Future;
pub use std::time::Duration;
pub use std::pin::Pin;
2021-11-22 11:28:30 -05:00
pub use std::ops::{FnOnce, FnMut, Fn};
2022-01-03 23:58:26 -05:00
pub use async_std::sync::Mutex as AsyncMutex;
pub use async_std::sync::MutexGuard as AsyncMutexGuard;
2021-11-22 11:28:30 -05:00
pub use std::net::{ SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs, IpAddr, Ipv4Addr, Ipv6Addr };
pub type SystemPinBoxFuture<T> = PinBox<dyn Future<Output = T> + Send + 'static>;
pub type SystemPinBoxFutureLifetime<'a, T> = PinBox<dyn Future<Output = T> + Send + 'a>;
}
}
// pub use bump_port::*;
2022-01-05 12:01:02 -05:00
pub use async_peek_stream::*;
pub use clone_stream::*;
2021-11-22 11:28:30 -05: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-12 20:58:02 -04:00
pub use must_join_handle::*;
pub use must_join_single_future::*;
2022-06-04 20:18:26 -04:00
pub use mutable_future::*;
2021-11-22 11:28:30 -05:00
pub use single_future::*;
pub use single_shot_eventual::*;
pub use tick_task::*;
pub use tools::*;