1use crate::FrameId;
2
3#[derive(Debug, PartialEq, thiserror::Error)]
5pub enum EvictError<F: FrameId> {
6 #[error("Invalid frame id: {0}")]
8 InvalidFrameId(F),
9
10 #[error("Trying to remove pinned frame: {0}")]
12 PinnedFrameRemoval(F),
13
14 #[error("Frame replacer is full")]
16 FrameReplacerFull,
17
18 #[error("Invalid timestamp")]
20 InvalidTimestamp,
21
22 #[error("No free frames available (nor in free list nor in frame replacer)")]
24 NoFramesAvailable,
25
26 #[error("Sequence generator exhausted")]
28 SequenceExhausted,
29}
30
31pub type EvictResult<T, F> = Result<T, EvictError<F>>;