chiark / gitweb /
client: wip code
[hippotat.git] / src / prelude.rs
1 // Copyright 2021 Ian Jackson and contributors to Hippotat
2 // SPDX-License-Identifier: AGPL-3.0-or-later
3 // There is NO WARRANTY.
4
5 pub use std::collections::{BTreeSet, HashMap};
6 pub use std::convert::TryInto;
7 pub use std::cmp::{min, max};
8 pub use std::fs;
9 pub use std::fmt::{self, Debug, Display};
10 pub use std::io::{self, ErrorKind, Read as _};
11 pub use std::iter;
12 pub use std::mem;
13 pub use std::net::{IpAddr, Ipv4Addr};
14 pub use std::path::{Path, PathBuf};
15 pub use std::panic;
16 pub use std::process;
17 pub use std::str::FromStr;
18 pub use std::sync::Arc;
19 pub use std::task::Poll;
20
21 pub use anyhow::{anyhow, Context};
22 pub use extend::ext;
23 pub use fehler::{throw, throws};
24 pub use futures::{poll, future};
25 pub use hyper::Uri;
26 pub use hyper_tls::HttpsConnector;
27 pub use ipnet::IpNet;
28 pub use itertools::{iproduct, Itertools};
29 pub use lazy_regex::{regex_is_match, regex_replace_all};
30 pub use log::{debug, info, error};
31 pub use structopt::StructOpt;
32 pub use tokio::io::AsyncBufReadExt;
33 pub use tokio::pin;
34 pub use tokio::select;
35 pub use tokio::task;
36 pub use tokio::time::Duration;
37 pub use void::{self, Void, ResultVoidExt, ResultVoidErrExt};
38
39 pub use crate::config::{self, InstanceConfig, u32Ext as _};
40 pub use crate::utils::*;
41 pub use crate::types::*;
42 pub use crate::slip;
43
44 pub use anyhow::Error as AE;
45 pub use ErrorKind as EK;
46
47 pub const SLIP_END:     u8 = 0o300;
48 pub const SLIP_ESC:     u8 = 0o333;
49 pub const SLIP_ESC_END: u8 = 0o334;
50 pub const SLIP_ESC_ESC: u8 = 0o335;
51
52 pub fn default<T:Default>() -> T { Default::default() }