pub async fn update(&mut self) -> io::Result<bool> {
        if self.read_buf.len() >= raw::EVENT_SIZE {
            let bytes_data = self.read_buf.split_to(raw::EVENT_SIZE).freeze();
            let mut buf: [u8; raw::EVENT_SIZE] = [0; raw::EVENT_SIZE];
            for i in 0..raw::EVENT_SIZE {
                buf[i] = bytes_data[i];
            }
            // insert this is fine meme here
            let raw_event: raw::RawEvent = unsafe { std::mem::transmute(buf) };
            //ignore init events
            if !raw::is_init_event(&raw_event) {
                let parsed_event = crate::raw::parse_event(raw_event);
                self.sink(parsed_event);
                Ok(true)
            } else {
                Ok(false)
            }
        } else {
            self.src.read_buf(&mut self.read_buf).await?;
            Ok(false)
        }
    }
/// Reads data from the internal source file,
/// and if there is enough, produces and processes a event,
/// 
/// returns if a new event was processed
/// 
/// # Cancel saftey
/// this is cancel safe, if it is canceled, no bytes will have been read or data lost.
Reads data from the internal source file,
and if there is enough, produces and processes a event.

returns if a new event was processed
Reads data from the internal source file and if there is enough produces and processes a event . returns if a new event was processed
pub async fn update(&mut self) -> io::Result<bool> {
        if self.read_buf.len() >= raw::EVENT_SIZE {
            let bytes_data = self.read_buf.split_to(raw::EVENT_SIZE).freeze();
            let mut buf: [u8; raw::EVENT_SIZE] = [0; raw::EVENT_SIZE];
            for i in 0..raw::EVENT_SIZE {
                buf[i] = bytes_data[i];
            }
            // insert this is fine meme here
            let raw_event: raw::RawEvent = unsafe { std::mem::transmute(buf) };
            //ignore init events
            if !raw::is_init_event(&raw_event) {
                let parsed_event = crate::raw::parse_event(raw_event);
                self.sink(parsed_event);
                Ok(true)
            } else {
                Ok(false)
            }
        } else {
            self.src.read_buf(&mut self.read_buf).await?;
            Ok(false)
        }
    }
pub async fn update ( & mut self ) -> io :: Result < bool > { if self . read_buf . len ( ) >= raw :: EVENT_SIZE { let bytes_data = self . read_buf . split_to ( raw :: EVENT_SIZE ) . freeze ( ) ; let mut buf : [ u8 ; raw :: EVENT_SIZE ] = [ 0 ; raw :: EVENT_SIZE ] ; for i in 0 .. raw :: EVENT_SIZE { buf [ i ] = bytes_data [ i ] ; } // insert this is fine meme here let raw_event : raw :: RawEvent = unsafe { std :: mem :: transmute ( buf ) } ; //ignore init events if ! raw :: is_init_event ( & raw_event ) { let parsed_event = crate :: raw :: parse_event ( raw_event ) ; self . sink ( parsed_event ) ; Ok ( true ) } else { Ok ( false ) } } else { self . src . read_buf ( & mut self . read_buf ) . await ? ; Ok ( false ) } }
Reads data from the internal source file,
and if there is enough, produces and processes a event,
Reads data from the internal source file and if there is enough produces and processes a event
&mut self
&mut self
cancel saftey
this is cancel safe, if it is canceled, no bytes will have been read or data lost.
this is cancel safe if it is canceled no bytes will have been read or data lost .