#[non_exhaustive]pub enum CodeModeError {
NotBunBinary(&'static str),
ModuleNotFound,
PatternInvalid {
name: &'static str,
source: Error,
},
AnchorCount {
name: &'static str,
found: usize,
},
ReplacementTooShort {
name: &'static str,
matched: usize,
replacement: usize,
},
Io(Error),
Sign(String),
Settings,
UnsupportedPlatform,
}Expand description
Error building the Code Mode binary.
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.
NotBunBinary(&'static str)
The CLI binary is not a Bun standalone executable this patch can read; the payload names the check that failed.
ModuleNotFound
No module contains the Code Mode opt-in marker.
PatternInvalid
A patch anchor’s regex does not compile.
AnchorCount
A patch anchor did not match exactly once.
ReplacementTooShort
A patch anchor matched fewer bytes than its replacement needs.
Fields
Io(Error)
A filesystem operation on the CLI binary or its patched copy failed,
or codesign could not run or timed out.
Sign(String)
codesign failed on the patched binary (macOS).
Settings
SessionOptions::settings (or its env) is not a JSON object.
UnsupportedPlatform
Code Mode was requested on a platform other than macOS or Linux.
Trait Implementations§
Source§impl Debug for CodeModeError
impl Debug for CodeModeError
Source§impl Display for CodeModeError
impl Display for CodeModeError
Source§impl Error for CodeModeError
impl Error for CodeModeError
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<CodeModeError> for SessionError
impl From<CodeModeError> for SessionError
Source§fn from(source: CodeModeError) -> Self
fn from(source: CodeModeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CodeModeError
impl !UnwindSafe for CodeModeError
impl Forget for CodeModeError
impl Freeze for CodeModeError
impl Move for CodeModeError
impl Send for CodeModeError
impl Sync for CodeModeError
impl Unpin for CodeModeError
impl UnsafeUnpin for CodeModeError
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