mail_core_ng/default_impl/
mod.rs

1//! This module provides an number of default implementations for some of the interfaces.
2//!
3//! For example it provides a default implementation for the context needed
4//! to build/encode a mail.
5#[cfg(feature="default_impl_cpupool")]
6mod cpupool;
7#[cfg(feature="default_impl_cpupool")]
8pub use self::cpupool::*;
9
10mod fs;
11pub use self::fs::*;
12
13mod message_id_gen;
14pub use self::message_id_gen::*;
15
16
17#[cfg(all(feature="default_impl_cpupool"))]
18pub mod simple_context;
19
20#[cfg(all(test, not(feature="default_impl_cpupool")))]
21compile_error!("test need following (default) features: default_impl_cpupool, default_impl_fs, default_impl_message_id_gen");
22
23#[cfg(test)]
24use soft_ascii_string::SoftAsciiString;
25#[cfg(test)]
26use headers::header_components::Domain;
27
28#[cfg(test)]
29pub type TestContext = simple_context::Context;
30
31//same crate so we can do this ;=)
32#[cfg(test)]
33pub fn test_context() -> TestContext {
34    //TODO crate a test context which does not access the file system
35    let domain = Domain::from_unchecked("fooblabar.test".to_owned());
36    let unique_part = SoftAsciiString::from_unchecked("CM0U3c412");
37    simple_context::new(domain, unique_part).unwrap()
38}
39
40
41
42