Enum Exceptions

Source
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

Source§

fn clone(&self) -> Exceptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Exceptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Exceptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Exceptions

Source§

fn eq(&self, other: &Exceptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Exceptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.