Enum ClrError

Source
pub enum ClrError {
Show 20 variants FileReadError(String), ApiError(&'static str, i32), MissingArguments, CastingError(&'static str), InvalidExecutable, MethodNotFound, PropertyNotFound, NotDotNet, MetaHostCreationError(String), RuntimeInfoError(String), RuntimeHostError(String), RuntimeStartError, DomainCreationError(String), DefaultDomainError(String), NoDomainAvailable, NullPointerError(&'static str), SafeArrayError(String), VariantUnsupported, GenericError(&'static str), InvalidNtHeader,
}
Expand description

Represents errors that can occur when interacting with the .NET runtime or while handling .NET-related operations within an unmanaged application.

Variants§

§

FileReadError(String)

Raised when a .NET file cannot be read correctly.

§Arguments

  • {0} - A message describing the file read error.
§

ApiError(&'static str, i32)

Raised when an API call fails, returning a specific HRESULT.

§Arguments

  • {0} - The name of the API that failed.
  • {1} - The HRESULT code returned by the API indicating the specific failure.
§

MissingArguments

Raised when an entry point expects arguments but receives none.

§

CastingError(&'static str)

Raised when there is an error casting a COM interface to the specified type.

§Arguments

  • {0} - The name of the type to which casting failed.
§

InvalidExecutable

Raised when the buffer provided does not represent a valid executable file.

§

MethodNotFound

Raised when a required method is not found in the .NET assembly.

§

PropertyNotFound

Raised when a required property is not found in the .NET assembly.

§

NotDotNet

Raised when the buffer does not contain a .NET application.

§

MetaHostCreationError(String)

Raised when there is a failure creating the .NET MetaHost.

§Arguments

  • {0} - A message describing the failure to create the MetaHost.
§

RuntimeInfoError(String)

Raised when retrieving information about the .NET runtime fails.

§Arguments

  • {0} - A message describing the error in runtime information retrieval.
§

RuntimeHostError(String)

Raised when the runtime host interface could not be obtained.

§Arguments

  • {0} - A message describing the failure to obtain the runtime host interface.
§

RuntimeStartError

Raised when the runtime fails to start.

§

DomainCreationError(String)

Raised when there is an error creating a new AppDomain.

§Arguments

  • {0} - A message describing the domain creation error.
§

DefaultDomainError(String)

Raised when the default AppDomain cannot be retrieved.

§Arguments

  • {0} - A message describing the error in retrieving the default AppDomain.
§

NoDomainAvailable

Raised when no AppDomain is available in the runtime environment.

§

NullPointerError(&'static str)

Raised when a null pointer is passed to an API where a valid reference was expected.

§Arguments

  • {0} - The name of the API that received the null pointer.
§

SafeArrayError(String)

Raised when there is an error creating a SafeArray.

§Arguments

  • {0} - A message describing the SafeArray creation error.
§

VariantUnsupported

Raised when the type of a VARIANT is unsupported by the current context.

§

GenericError(&'static str)

Represents a generic error specific to the CLR.

§Arguments

  • {0} - A message providing details about the CLR-specific error.
§

InvalidNtHeader

Related error if the PE file used in the loader does not have a valid NT HEADER

Trait Implementations§

Source§

impl Debug for ClrError

Source§

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

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

impl Display for ClrError

Source§

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

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

impl Error for ClrError

1.30.0 · Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.