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.
Trait Implementations§
Source§impl Debug for PatchError
impl Debug for PatchError
Source§impl Display for PatchError
impl Display for PatchError
Source§impl Error for PatchError
impl Error for PatchError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()