pub enum JavaError {
Io(String),
CompilationFailed(String),
RuntimeFailed(String),
InvalidUtf8(FromUtf8Error),
InvalidChar,
}Expand description
All errors that java! and java_fn! can return at runtime (and that
ct_java! maps to compile_error! diagnostics at build time).
Variants§
Io(String)
An I/O error while creating the temp directory, writing the source
file, or spawning javac/java (e.g. the binary is not on PATH).
CompilationFailed(String)
javac exited with a non-zero status. The 0 field contains the
compiler diagnostic output (stderr).
RuntimeFailed(String)
The JVM exited with a non-zero status (e.g. an unhandled exception).
The 0 field contains the exception message and stack trace (stderr).
InvalidUtf8(FromUtf8Error)
The Java run() method returned a String whose bytes are not valid
UTF-8.
InvalidChar
The Java run() method returned a char value that is not a valid
Unicode scalar (i.e. a lone surrogate half).
Trait Implementations§
Source§impl Error for JavaError
impl Error for JavaError
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<FromUtf8Error> for JavaError
impl From<FromUtf8Error> for JavaError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
impl Eq for JavaError
impl StructuralPartialEq for JavaError
Auto Trait Implementations§
impl Freeze for JavaError
impl RefUnwindSafe for JavaError
impl Send for JavaError
impl Sync for JavaError
impl Unpin for JavaError
impl UnsafeUnpin for JavaError
impl UnwindSafe for JavaError
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