pub enum Exceptions {
Super,
Easy,
NullPointer,
ArrayIndexOutOfBounds,
IllegalArgState,
IO,
FileNotFound,
SQL,
Interrupted,
ClassCast,
UnSupportedOperation,
Define,
}
Expand description
§Exceptions enum
- Super(顶级异常):顶级异常只能用于简单的处理,实际上他并不能显式的知道程序到底有什么问题,需要更加具体的异常。它虽然是顶级异常,但却是最低级的异常。
- NullPointerException(空指针异常):当代码尝试访问一个空对象的方法或属性时抛出。
- ArrayIndexOutOfBoundsException(数组越界异常):当试图访问数组中不存在的索引位置时抛出。
- IllegalArgStateException(非法参数|状态异常):当传递给方法的参数不符合要求或无效时抛出或对象的状态与调用方法的前提条件不符时抛出。
- IOException(输入/输出异常):当发生与输入/输出操作相关的错误时抛出,如文件读写错误、网络连接问题等。
- FileNotFoundException(文件未找到异常):当尝试打开或访问不存在的文件时抛出。
- SQLException(SQL异常):与数据库操作相关的异常,如连接失败、SQL语句错误等。
- InterruptedException(线程中断异常):当线程在等待或睡眠状态被中断时抛出。
- ClassCastException(类转换异常):当试图将一个对象强制转换为其不兼容的类型时抛出。
- UnsupportedOperationException(不支持的操作异常):当调用对象不支持的方法或操作时抛出。
- Define(自定义异常):当自己定义非上访的异常时。
Variants§
Super
Easy
NullPointer
ArrayIndexOutOfBounds
IllegalArgState
IO
FileNotFound
SQL
Interrupted
ClassCast
UnSupportedOperation
Define
Trait Implementations§
Source§impl Clone for Exceptions
impl Clone for Exceptions
Source§fn clone(&self) -> Exceptions
fn clone(&self) -> Exceptions
Returns a duplicate 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 Exceptions
impl Debug for Exceptions
Source§impl Default for Exceptions
impl Default for Exceptions
Source§impl PartialEq for Exceptions
impl PartialEq for Exceptions
impl StructuralPartialEq for Exceptions
Auto Trait Implementations§
impl Freeze for Exceptions
impl RefUnwindSafe for Exceptions
impl Send for Exceptions
impl Sync for Exceptions
impl Unpin for Exceptions
impl UnwindSafe for Exceptions
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