pub struct FileProgress {
pub operation: FileOperation,
pub bytes_done: u64,
pub bytes_total: Option<u64>,
pub message: Option<String>,
}Expand description
Progress snapshot for one filesystem operation.
Byte counts use bytes, but no invariant enforces bytes_done <= bytes_total.
bytes_total == None means unknown, while Some(0) is a known empty total.
An absent message is distinct from an explicitly empty message.
§Examples
use ailloli_ui_fs::{FileOperation, FileProgress, FileUri};
let progress = FileProgress::new(FileOperation::ReadFile { uri: FileUri::parse("file:///tmp/a")? });
assert_eq!((progress.bytes_done, progress.bytes_total), (0, None));Fields§
§operation: FileOperationOperation whose progress is being reported.
bytes_done: u64Bytes completed so far; may exceed a separately supplied total.
bytes_total: Option<u64>Known total bytes, or None when indeterminate.
message: Option<String>Optional provider-facing status text; None means no message.
Implementations§
Source§impl FileProgress
impl FileProgress
Sourcepub fn new(operation: FileOperation) -> Self
pub fn new(operation: FileOperation) -> Self
Starts an indeterminate progress snapshot at zero completed bytes.
§Examples
use ailloli_ui_fs::{FileOperation, FileProgress, FileUri};
let progress = FileProgress::new(FileOperation::Metadata { uri: FileUri::parse("file:///tmp/a")? });
assert_eq!(progress.message, None);Trait Implementations§
Source§impl Clone for FileProgress
impl Clone for FileProgress
Source§fn clone(&self) -> FileProgress
fn clone(&self) -> FileProgress
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileProgress
impl Debug for FileProgress
Source§impl<'de> Deserialize<'de> for FileProgress
impl<'de> Deserialize<'de> for FileProgress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FileProgress
impl PartialEq for FileProgress
Source§impl Serialize for FileProgress
impl Serialize for FileProgress
impl Eq for FileProgress
impl StructuralPartialEq for FileProgress
Auto Trait Implementations§
impl Freeze for FileProgress
impl RefUnwindSafe for FileProgress
impl Send for FileProgress
impl Sync for FileProgress
impl Unpin for FileProgress
impl UnwindSafe for FileProgress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more