buffer_plz/event.rs
1use crate::Cursor;
2
3// Event's created by the IO
4pub enum Event<'a, 'b> {
5 Read(&'a mut Cursor<'b>),
6 End(&'a mut Cursor<'b>),
7}
8
9impl<'a, 'b> AsMut<Event<'a, 'b>> for Event<'a, 'b> {
10 fn as_mut(&mut self) -> &mut Self {
11 self
12 }
13}
14
15impl<'a, 'b> Event<'a, 'b> {
16 pub fn inner_mut(&mut self) -> &mut Cursor<'b> {
17 match self {
18 Event::Read(cursor) | Event::End(cursor) => cursor,
19 }
20 }
21}