#[non_exhaustive]pub enum Error {
Io(Error),
Utf8(Utf8Error),
FromBytesWithNul(FromBytesWithNulError),
Boxed(Box<dyn Error>),
Throw(ThrowObject),
ClassNotFound(ClassNotFoundError),
ArgumentCount(ArgumentCountError),
InitializeObject(InitializeObjectError),
ExpectType(ExpectTypeError),
NotImplementThrowable(NotImplementThrowableError),
}
Expand description
Crate level Error, which also can become an exception in php.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io(Error)
The error type for I/O operations.
Utf8(Utf8Error)
Errors which can occur when attempting to interpret a sequence of u8
as a string.
FromBytesWithNul(FromBytesWithNulError)
An error indicating that a nul byte was not in the expected position.
Boxed(Box<dyn Error>)
Owned boxed dynamic error.
Throw(ThrowObject)
Owned exception object.
ClassNotFound(ClassNotFoundError)
Class not found, get the class by name failed, etc.
ArgumentCount(ArgumentCountError)
Throw when actual arguments count is not greater than expect in calling functions.
InitializeObject(InitializeObjectError)
Failed to initialize object.
ExpectType(ExpectTypeError)
Expect type is not the actual type.
NotImplementThrowable(NotImplementThrowableError)
Failed when the object isn’t implement PHP Throwable
.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<ArgumentCountError> for Error
impl From<ArgumentCountError> for Error
Source§fn from(source: ArgumentCountError) -> Self
fn from(source: ArgumentCountError) -> Self
Converts to this type from the input type.
Source§impl From<ClassNotFoundError> for Error
impl From<ClassNotFoundError> for Error
Source§fn from(source: ClassNotFoundError) -> Self
fn from(source: ClassNotFoundError) -> Self
Converts to this type from the input type.
Source§impl From<ExpectTypeError> for Error
impl From<ExpectTypeError> for Error
Source§fn from(source: ExpectTypeError) -> Self
fn from(source: ExpectTypeError) -> Self
Converts to this type from the input type.
Source§impl From<FromBytesWithNulError> for Error
impl From<FromBytesWithNulError> for Error
Source§fn from(source: FromBytesWithNulError) -> Self
fn from(source: FromBytesWithNulError) -> Self
Converts to this type from the input type.
Source§impl From<InitializeObjectError> for Error
impl From<InitializeObjectError> for Error
Source§fn from(source: InitializeObjectError) -> Self
fn from(source: InitializeObjectError) -> Self
Converts to this type from the input type.
Source§impl From<NotImplementThrowableError> for Error
impl From<NotImplementThrowableError> for Error
Source§fn from(source: NotImplementThrowableError) -> Self
fn from(source: NotImplementThrowableError) -> Self
Converts to this type from the input type.
Source§impl From<ThrowObject> for Error
impl From<ThrowObject> for Error
Source§fn from(source: ThrowObject) -> Self
fn from(source: ThrowObject) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl !Send for Error
impl !Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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