1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! # FileGo
//!
//! A file splitting & merging solution.
//!
//! ## Quick Start
//!
//! Split file from a path to a directory with `Split` struct.
//!
//! ```no_run
//! use std::path::PathBuf;
//!
//! use filego::split::{Split, SplitResult};
//!
//! let result: SplitResult = Split::new()
//! .in_file(PathBuf::from("path").join("to").join("file"))
//! .out_dir(PathBuf::from("path").join("to").join("dir"))
//! .run()
//! .unwrap();
//! ```
//!
//! Async version also available with the `async-std` and `tokio` features:
//!
//! ```no_run
//! // This is a `async-std` example
//!
//! use async_std::path::PathBuf;
//!
//! use filego::split::{
//! Split,
//! SplitResult,
//! async_std::SplitAsyncExt as _,
//! };
//!
//! # async fn example() {
//! let result: SplitResult = Split::new()
//! .in_file(PathBuf::from("path").join("to").join("file"))
//! .out_dir(PathBuf::from("path").join("to").join("dir"))
//! .run_async()
//! .await
//! .unwrap();
//! # }
//! ```
//!
//! ```no_run
//! // This is a `tokio` example
//!
//! use std::path::PathBuf;
//!
//! use filego::split::{
//! Split,
//! SplitResult,
//! tokio::SplitAsyncExt as _,
//! };
//!
//! # async fn example() {
//! let result: SplitResult = Split::new()
//! .in_file(PathBuf::from("path").join("to").join("file"))
//! .out_dir(PathBuf::from("path").join("to").join("dir"))
//! .run_async()
//! .await
//! .unwrap();
//! # }
//! ```
/// Split module.
/// Check module.
/// Merge module.
/// Functions implemented with `async-std`.
pub
/// Functions implemented with `tokio`.
pub
/// The default chunk size in bytes.
pub const CHUNK_SIZE_DEFAULT: usize = 2 * 1024 * 1024;
/// The default maximum size of the buffer capacity in bytes.
pub const BUFFER_CAPACITY_MAX_DEFAULT: usize = 10 * 1024 * 1024;