use crate::geom::{Offset, Rect};
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum Response {
Unused,
Used,
}
impl Response {
#[inline]
pub fn is_used(&self) -> bool {
matches!(self, Response::Used)
}
#[inline]
pub fn is_unused(&self) -> bool {
matches!(self, Response::Unused)
}
}
impl std::ops::BitOr for Response {
type Output = Self;
#[inline]
fn bitor(self, rhs: Self) -> Self {
use Response::{Unused, Used};
match (self, rhs) {
(Unused, Unused) => Unused,
_ => Used,
}
}
}
impl std::ops::BitOrAssign for Response {
#[inline]
fn bitor_assign(&mut self, rhs: Self) {
*self = *self | rhs;
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[must_use]
pub enum Scroll {
None,
Scrolled,
Offset(Offset),
Rect(Rect),
}