2025-06-04 13:25:00 +00:00
|
|
|
mod checked;
|
|
|
|
|
mod uploading;
|
2025-05-27 00:42:43 +00:00
|
|
|
|
2025-06-08 17:13:01 +00:00
|
|
|
use std::{
|
|
|
|
|
ffi::OsStr,
|
|
|
|
|
path::{Path, PathBuf},
|
|
|
|
|
};
|
2025-06-06 23:48:10 +00:00
|
|
|
|
2025-06-04 13:25:00 +00:00
|
|
|
pub use checked::FileChecked;
|
2025-06-05 01:13:54 +00:00
|
|
|
pub use uploading::{ChunkState, FileUploading, UploadError};
|
2025-05-27 00:42:43 +00:00
|
|
|
|
2025-06-06 23:48:10 +00:00
|
|
|
pub trait SharryFile<'t> {
|
|
|
|
|
/// extract the filename part of a `Path` reference
|
|
|
|
|
///
|
|
|
|
|
/// # Panics
|
|
|
|
|
///
|
|
|
|
|
/// Expects `path::Path::file_name` and `ffi::OsStr::to_str` to succeed on the given path
|
|
|
|
|
fn extract_file_name(p: &'t Path) -> &'t str {
|
|
|
|
|
p.file_name()
|
|
|
|
|
.and_then(OsStr::to_str)
|
|
|
|
|
.expect("bad file name")
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-08 17:13:01 +00:00
|
|
|
fn into_path(self) -> PathBuf;
|
|
|
|
|
|
2025-06-06 23:48:10 +00:00
|
|
|
fn get_name(&'t self) -> &'t str;
|
|
|
|
|
|
|
|
|
|
fn get_size(&self) -> u64;
|
|
|
|
|
}
|