shared_resources/
errors.rs1#[derive(Debug, Copy, Clone, Eq, PartialEq)]
3pub enum AccessError {
4 NoSuchResource,
6
7 AlreadyBorrowed,
9}
10
11impl std::fmt::Display for AccessError {
12 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13 match self {
14 AccessError::NoSuchResource => write!(f, "There is no resource of the requested type."),
15 AccessError::AlreadyBorrowed => {
16 write!(f, "The requested resource is already borrowed.")
17 }
18 }
19 }
20}
21
22impl std::error::Error for AccessError {}