Skip to main content

PatchError

Enum PatchError 

Source
pub enum PatchError {
    Dlopen(String),
    AndroidMemfd(String),
    AnchorUnresolved,
    ReleaseBuild,
    ImageRangeUnresolved,
    LayoutMismatchPending(Vec<LayoutMismatch>),
    AnchorMismatch {
        image: &'static str,
        expected: u64,
        got: u64,
    },
}
Expand description

Why a patch could not be applied. On every error nothing is installed and no handler runs.

Variants§

§

Dlopen(String)

The patch library failed to load, or lacks the __frust_hotpatch_anchor symbol. A String rather than the loader’s error type keeps libloading out of the public API.

§

AndroidMemfd(String)

The Android memfd loader failed, most likely on a permissions issue.

§

AnchorUnresolved

No anchor is set (set_anchor was never called with a non-zero address), so the table’s keys cannot be rebased onto this process. Checked before the library is loaded.

§

ReleaseBuild

This is a release-profile build: patches are applied only under debug_assertions.

§

ImageRangeUnresolved

The platform could not say which loaded image holds an anchor, so missed keys could not be attributed to an image. Nothing is installed.

§

LayoutMismatchPending(Vec<LayoutMismatch>)

Layout-mismatch records are unreported (see report_layout_mismatch): no patch is applied over a known mismatch. Carries the unreported records; checked under the apply lock before anything is loaded, and cleared by mark_layout_mismatches_reported.

§

AnchorMismatch

The table’s anchor address for image ("base" or "patch") is not that image’s __frust_hotpatch_anchor link-time address: the offset it implies (got) differs from the image’s real slide (expected). A table anchored on another symbol (dx 0.7.10 anchors on main) is refused rather than rebased by a wrong constant. The "base" check runs before the library is loaded; for "patch" the library is already mapped and leaked (never unloaded), as with PatchError::ImageRangeUnresolved after the load. Nothing is registered or installed.

Fields

§image: &'static str

Which image’s anchor disagrees: "base" or "patch".

§expected: u64

The image’s real slide, from the platform loader.

§got: u64

The offset the table’s anchor address implies.

Trait Implementations§

Source§

impl Debug for PatchError

Source§

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

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

impl Display for PatchError

Source§

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

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

impl Error for PatchError

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
Source§

impl PartialEq for PatchError

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PatchError

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.