pop3_client/client/
mod.rs1use crate::{Command, Response, Pop3Error};
2
3pub type Result<T> = std::result::Result<T, Pop3Error>;
4
5#[cfg(feature = "runtime-sync")]
6mod sync;
7
8
9#[cfg(feature = "runtime-tokio")]
10mod tokio;
11
12
13#[cfg(feature = "runtime-sync")]
14pub use sync::SyncClient;
15
16
17#[cfg(feature = "runtime-tokio")]
18pub use tokio::AsyncClient;
19
20fn join_bytes(arrays: &[&[u8]], separator: u8) -> Vec<u8> {
21 let cap: usize = arrays.iter().map(|a| a.len()).sum();
22
23 let mut result = Vec::with_capacity(cap + arrays.len() - 1);
24
25 for (i, array) in arrays.iter().enumerate() {
26 result.extend_from_slice(array);
27 if i < arrays.len() - 1 {
28 result.push(separator);
29 }
30 }
31
32 result
33}
34