ps_mmap/error.rs
1use std::fs;
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum DerefError {
7 #[error("Cannot mutably dereference a read-only MemoryMap.")]
8 ReadOnly,
9}
10
11/// This error occurs when mapping a file into memory fails.
12#[derive(Error, Debug)]
13pub enum MapError {
14 #[error(transparent)]
15 IoError(#[from] std::io::Error),
16 #[error("Failed to acquire exclusive lock (file may be in use by another process)")]
17 LockFailed(#[from] fs::TryLockError),
18}