pub struct SafeOperations;Expand description
Safe wrapper for common operations that might fail
Implementations§
Source§impl SafeOperations
impl SafeOperations
Sourcepub fn current_dir() -> Result<PathBuf, SolarboatError>
pub fn current_dir() -> Result<PathBuf, SolarboatError>
Safely get current directory with proper error handling
Sourcepub fn canonicalize(path: &Path) -> Result<PathBuf, SolarboatError>
pub fn canonicalize(path: &Path) -> Result<PathBuf, SolarboatError>
Safely canonicalize a path with proper error handling
Sourcepub fn os_str_to_string(os_str: &OsStr) -> Result<String, SolarboatError>
pub fn os_str_to_string(os_str: &OsStr) -> Result<String, SolarboatError>
Safely convert OsStr to string with proper error handling
Sourcepub fn lock_with_timeout<'a, T>(
mutex: &'a Arc<Mutex<T>>,
timeout: Duration,
resource_name: &str,
) -> Result<MutexGuard<'a, T>, SolarboatError>
pub fn lock_with_timeout<'a, T>( mutex: &'a Arc<Mutex<T>>, timeout: Duration, resource_name: &str, ) -> Result<MutexGuard<'a, T>, SolarboatError>
Safely acquire a mutex lock with timeout
Sourcepub fn with_retry<F, T, E>(
f: F,
config: BackoffConfig,
error_context: &str,
) -> Result<T, SolarboatError>
pub fn with_retry<F, T, E>( f: F, config: BackoffConfig, error_context: &str, ) -> Result<T, SolarboatError>
Execute a function with retry logic (synchronous version)
Auto Trait Implementations§
impl Freeze for SafeOperations
impl RefUnwindSafe for SafeOperations
impl Send for SafeOperations
impl Sync for SafeOperations
impl Unpin for SafeOperations
impl UnsafeUnpin for SafeOperations
impl UnwindSafe for SafeOperations
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