2017-09-07 23:00:08 +03:00
|
|
|
/*
|
|
|
|
* meli - lib.rs
|
|
|
|
*
|
|
|
|
* Copyright 2017 Manos Pitsidianakis
|
|
|
|
*
|
|
|
|
* This file is part of meli.
|
|
|
|
*
|
|
|
|
* meli is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* meli is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with meli. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2019-05-01 19:20:33 +03:00
|
|
|
#[macro_use]
|
|
|
|
pub mod dbg {
|
2019-05-13 22:05:00 +03:00
|
|
|
#[allow(clippy::redundant_closure)]
|
2019-05-01 19:20:33 +03:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! debug {
|
2019-05-07 01:54:20 +03:00
|
|
|
($val:literal) => {
|
2019-05-12 17:37:07 +03:00
|
|
|
{
|
2019-05-07 01:54:20 +03:00
|
|
|
if cfg!(debug_assertions) {
|
|
|
|
eprint!(
|
|
|
|
"[{:?}] {}:{}_{}: ",
|
|
|
|
std::thread::current()
|
|
|
|
.name()
|
|
|
|
.map(|v| v.to_string())
|
|
|
|
.unwrap_or_else(|| format!("{:?}", std::thread::current().id())),
|
|
|
|
file!(),
|
|
|
|
line!(),
|
|
|
|
column!()
|
|
|
|
);
|
|
|
|
eprintln!($val);
|
|
|
|
}
|
2019-05-12 17:37:07 +03:00
|
|
|
$val
|
|
|
|
}
|
2019-05-07 01:54:20 +03:00
|
|
|
};
|
2019-05-01 19:20:33 +03:00
|
|
|
($val:expr) => {
|
2019-05-12 17:37:07 +03:00
|
|
|
{
|
2019-05-01 19:20:33 +03:00
|
|
|
if cfg!(debug_assertions) {
|
|
|
|
eprint!(
|
|
|
|
"[{:?}] {}:{}_{}: ",
|
|
|
|
std::thread::current()
|
|
|
|
.name()
|
|
|
|
.map(|v| v.to_string())
|
|
|
|
.unwrap_or_else(|| format!("{:?}", std::thread::current().id())),
|
|
|
|
file!(),
|
|
|
|
line!(),
|
|
|
|
column!()
|
|
|
|
);
|
2019-05-03 23:50:58 +03:00
|
|
|
eprintln!("{} = {:?}", stringify!($val), $val);
|
2019-05-01 19:20:33 +03:00
|
|
|
}
|
2019-05-12 17:37:07 +03:00
|
|
|
$val
|
|
|
|
}
|
2019-05-01 19:20:33 +03:00
|
|
|
};
|
|
|
|
($fmt:literal, $($arg:tt)*) => {
|
|
|
|
if cfg!(debug_assertions) {
|
|
|
|
eprint!(
|
|
|
|
"[{:?}] {}:{}_{}: ",
|
|
|
|
std::thread::current()
|
|
|
|
.name()
|
|
|
|
.map(|v| v.to_string())
|
|
|
|
.unwrap_or_else(|| format!("{:?}", std::thread::current().id())),
|
|
|
|
file!(),
|
|
|
|
line!(),
|
|
|
|
column!()
|
|
|
|
);
|
|
|
|
eprintln!($fmt, $($arg)*);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-14 12:19:25 +02:00
|
|
|
pub mod addressbook;
|
2019-04-04 14:21:52 +03:00
|
|
|
pub mod async_workers;
|
2017-09-07 23:00:08 +03:00
|
|
|
pub mod conf;
|
|
|
|
pub mod error;
|
2019-05-26 02:10:57 +03:00
|
|
|
pub mod grapheme_clusters;
|
2018-07-27 21:37:56 +03:00
|
|
|
pub mod mailbox;
|
2019-05-26 02:10:57 +03:00
|
|
|
mod wcwidth;
|
|
|
|
pub use self::grapheme_clusters::*;
|
|
|
|
pub use self::wcwidth::*;
|
2019-05-26 21:34:34 +03:00
|
|
|
mod structs;
|
|
|
|
pub use self::structs::*;
|
2017-09-07 23:00:08 +03:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate serde_derive;
|
|
|
|
/* parser */
|
|
|
|
#[macro_use]
|
|
|
|
extern crate nom;
|
|
|
|
extern crate chrono;
|
2018-07-24 20:20:32 +03:00
|
|
|
extern crate data_encoding;
|
2018-07-27 21:37:56 +03:00
|
|
|
extern crate encoding;
|
|
|
|
extern crate memmap;
|
2018-08-03 13:46:08 +03:00
|
|
|
#[macro_use]
|
|
|
|
extern crate chan;
|
2017-09-16 19:15:51 +03:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate bitflags;
|
2019-02-15 09:06:42 +02:00
|
|
|
extern crate fnv;
|
2019-03-14 12:19:25 +02:00
|
|
|
extern crate uuid;
|
2017-09-28 18:06:35 +03:00
|
|
|
|
|
|
|
pub use conf::*;
|
2018-07-27 21:37:56 +03:00
|
|
|
pub use mailbox::*;
|
2017-09-28 18:06:35 +03:00
|
|
|
|
2018-07-27 21:37:56 +03:00
|
|
|
pub use error::{MeliError, Result};
|
|
|
|
pub use mailbox::backends::{Backends, RefreshEvent, RefreshEventConsumer};
|
2017-10-01 17:31:20 +03:00
|
|
|
pub use mailbox::email::{Envelope, Flag};
|
2019-02-15 09:06:42 +02:00
|
|
|
|
|
|
|
pub use addressbook::*;
|