mod checked; mod chunk; mod uploading; use std::{ffi::OsStr, path::Path}; pub use checked::Checked; pub use chunk::Chunk; pub use uploading::Uploading; pub trait FileTrait<'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") } /// get a reference to the file's name fn get_name(&'t self) -> &'t str; /// get the file's size fn get_size(&self) -> u64; }