| 138 | |
| 139 | impl std::fmt::Display for MemoryError { |
| 140 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 141 | match self { |
| 142 | MemoryError::NotFound { path } => write!(f, "File not found: {}", path), |
| 143 | MemoryError::NotADirectory { path } => write!(f, "Not a directory: {}", path), |
| 144 | MemoryError::IsADirectory { path } => write!(f, "Is a directory: {}", path), |
| 145 | MemoryError::PermissionDenied { path } => write!(f, "Permission denied: {}", path), |
| 146 | MemoryError::AlreadyExists { path } => write!(f, "Already exists: {}", path), |
| 147 | MemoryError::DirectoryNotEmpty { path } => write!(f, "Directory not empty: {}", path), |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | impl std::error::Error for MemoryError {} |