pub enum UploadError {
NotFound,
OffsetMismatch {
expected: u64,
},
Conflict,
TooLarge,
SizeExceeded,
TooManySessions,
Checksum {
expected: String,
actual: String,
dest_rel: String,
},
Io {
detail: String,
raw_os_error: Option<i32>,
},
}Expand description
Why an upload operation was refused.
Variants§
NotFound
No such session (unknown id, or already completed/cancelled/expired).
OffsetMismatch
The chunk did not start where the session expects.
Conflict
Another live session already targets this destination.
TooLarge
The chunk exceeds the advertised chunk size.
SizeExceeded
This chunk would push the session past the size declared at creation.
TooManySessions
Too many sessions are already open (see MAX_CONCURRENT_UPLOADS).
Checksum
The assembled bytes do not hash to what was declared.
Fields
dest_rel: StringThe destination the rejected session was headed for. Widened for
this field for the same reason UploadStore::cancel’s return
type was: an audit event for a terminal upload outcome should be
able to name its subject. dest_rel is not consumed before this
variant is built — take_for_complete only borrows it (for
self.release(&dest_rel)) beforehand — so there was never a
reason it could not be carried here; the field was simply never
added.
Io
The filesystem refused.
Fields
detail: StringAlready-rendered detail (ToString of the underlying
io::Error). A String, not the io::Error itself: UploadError
derives Clone/PartialEq/Eq, neither of which io::Error
implements.
raw_os_error: Option<i32>The underlying io::Error’s raw_os_error(), carried alongside
detail so a caller can tell ENOSPC apart from an unrelated
failure without a locale-dependent match on the rendered message
— see platform::is_out_of_space, which upload_error_response
(src/api/fs.rs) uses this to answer.
Trait Implementations§
Source§impl Clone for UploadError
impl Clone for UploadError
Source§fn clone(&self) -> UploadError
fn clone(&self) -> UploadError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UploadError
impl Debug for UploadError
impl Eq for UploadError
Source§impl From<Error> for UploadError
impl From<Error> for UploadError
Source§impl PartialEq for UploadError
impl PartialEq for UploadError
impl StructuralPartialEq for UploadError
Auto Trait Implementations§
impl Freeze for UploadError
impl RefUnwindSafe for UploadError
impl Send for UploadError
impl Sync for UploadError
impl Unpin for UploadError
impl UnsafeUnpin for UploadError
impl UnwindSafe for UploadError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.