pub enum UploadError {
FileNotFound(String),
MoveFailed {
from: String,
to: String,
error: String,
},
DirectoryCreateFailed(String),
DirectoryNotWritable(String),
UploadFailed(String),
Io(Error),
Persist(PersistError),
InvalidFileName(String),
}Expand description
上传错误 — 对齐 PHP think\exception\FileException
Variants§
FileNotFound(String)
文件不存在(对齐 PHP 第 42 行:The file "%s" does not exist)
MoveFailed
文件移动失败(对齐 PHP 第 112 行:Could not move the file "%s" to "%s" (%s))
DirectoryCreateFailed(String)
目录创建失败(对齐 PHP 第 130 行:Unable to create the "%s" directory)
DirectoryNotWritable(String)
目录不可写(对齐 PHP 第 133 行:Unable to write in the "%s" directory)
UploadFailed(String)
上传失败(对齐 PHP UploadedFile::getErrorMessage())
Io(Error)
IO 错误
Persist(PersistError)
临时文件持久化错误(对齐 tempfile::PersistError)
InvalidFileName(String)
文件名非法(路径遍历攻击防护)
Trait Implementations§
Source§impl Debug for UploadError
impl Debug for UploadError
Source§impl Display for UploadError
impl Display for UploadError
Source§impl Error for UploadError
impl Error for UploadError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for UploadError
impl From<Error> for UploadError
Source§fn from(source: Error) -> UploadError
fn from(source: Error) -> UploadError
Converts to this type from the input type.
Source§impl From<PersistError> for UploadError
impl From<PersistError> for UploadError
Source§fn from(source: PersistError) -> UploadError
fn from(source: PersistError) -> UploadError
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for UploadError
impl !UnwindSafe for UploadError
impl Freeze for UploadError
impl Send for UploadError
impl Sync for UploadError
impl Unpin for UploadError
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.