pub struct JavaLocatorError { /* private fields */ }Expand description
Error type for Java locator operations.
This error type encapsulates various errors that can occur when locating or working with Java installations.
§Examples
use java_manager::JavaLocatorError;
let error = JavaLocatorError::new("Java not found".to_string());
println!("Error: {}", error);Implementations§
Source§impl JavaLocatorError
impl JavaLocatorError
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Sourcepub fn java_not_found() -> Self
pub fn java_not_found() -> Self
Sourcepub fn file_not_found(file_name: &str, java_home: &str) -> Self
pub fn file_not_found(file_name: &str, java_home: &str) -> Self
Creates an error indicating a file was not found in the Java installation.
§Arguments
file_name- Name of the file that was not foundjava_home- Java home directory where the file was searched
§Returns
A JavaLocatorError with appropriate message
§Examples
use java_manager::JavaLocatorError;
let error = JavaLocatorError::file_not_found("libjsig.so", "/usr/lib/jvm/java-11");Sourcepub fn command_failed(command: &str, error: &str) -> Self
pub fn command_failed(command: &str, error: &str) -> Self
Creates an error indicating a command execution failure.
§Arguments
command- Command that failederror- Underlying error
§Returns
A JavaLocatorError with appropriate message
§Examples
use java_manager::JavaLocatorError;
let error = JavaLocatorError::command_failed("java -version", "Permission denied");Sourcepub fn invalid_installation(path: &str, reason: &str) -> Self
pub fn invalid_installation(path: &str, reason: &str) -> Self
Creates an error indicating an invalid Java installation.
§Arguments
path- Path to the invalid Java installationreason- Reason why the installation is invalid
§Returns
A JavaLocatorError with appropriate message
§Examples
use java_manager::JavaLocatorError;
let error = JavaLocatorError::invalid_installation("/invalid/path", "Executable not found");Sourcepub fn invalid_utf8_path(path: &str) -> Self
pub fn invalid_utf8_path(path: &str) -> Self
Trait Implementations§
Source§impl Debug for JavaLocatorError
impl Debug for JavaLocatorError
Source§impl Display for JavaLocatorError
impl Display for JavaLocatorError
Source§impl Error for JavaLocatorError
impl Error for JavaLocatorError
Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
fn description(&self) -> &str
Returns the error description (for compatibility with std::error::Error).
§Returns
Error description
Source§fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
fn cause(&self) -> Option<&dyn Error>
Source§impl From<Error> for JavaLocatorError
impl From<Error> for JavaLocatorError
Source§impl From<PatternError> for JavaLocatorError
impl From<PatternError> for JavaLocatorError
Source§fn from(err: PatternError) -> JavaLocatorError
fn from(err: PatternError) -> JavaLocatorError
Auto Trait Implementations§
impl Freeze for JavaLocatorError
impl RefUnwindSafe for JavaLocatorError
impl Send for JavaLocatorError
impl Sync for JavaLocatorError
impl Unpin for JavaLocatorError
impl UnwindSafe for JavaLocatorError
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