The writable database handle, or an error for read-only pristines.
(&self)
| 248 | |
| 249 | /// The writable database handle, or an error for read-only pristines. |
| 250 | fn writable_db(&self) -> PristineResult<&Database> { |
| 251 | match self { |
| 252 | Self::Writable(db, _) => Ok(db), |
| 253 | Self::ReadOnly(_) => Err(PristineError::Io(std::io::Error::new( |
| 254 | std::io::ErrorKind::PermissionDenied, |
| 255 | "cannot write through a read-only pristine handle", |
| 256 | ))), |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | impl Pristine { |
no outgoing calls