pub struct IOEvent<C: IOCallback>(pub Box<IOEvent_<C>>);Tuple Fields§
§0: Box<IOEvent_<C>>Implementations§
Source§impl<C: IOCallback> IOEvent<C>
impl<C: IOCallback> IOEvent<C>
pub fn new(fd: RawFd, buf: Buffer, action: IOAction, offset: i64) -> IOEvent<C>
Sourcepub fn set_callback(&mut self, cb: C)
pub fn set_callback(&mut self, cb: C)
Set callback for IOEvent, might be closure or a custom struct
pub fn get_size(&self) -> usize
pub fn get_buf_ref<'a>(&'a self) -> &'a [u8] ⓘ
pub fn is_done(&self) -> bool
pub fn get_write_result(self) -> Result<(), Errno>
Sourcepub fn get_result(&self) -> Result<usize, Errno>
pub fn get_result(&self) -> Result<usize, Errno>
Get the result of the IO operation (bytes read/written or error). Returns the number of bytes successfully transferred.
Sourcepub fn get_read_result(self) -> Result<Buffer, Errno>
pub fn get_read_result(self) -> Result<Buffer, Errno>
Get the buffer from a read operation.
Note: The buffer length is NOT modified. Use get_result() to get actual bytes read.
Sourcepub fn callback_merged(self)
pub fn callback_merged(self)
For writing custom callback workers
Callback worker should always call this function on receiving IOEvent from Driver
Trait Implementations§
Source§impl<C: IOCallback> Debug for IOEvent<C>
impl<C: IOCallback> Debug for IOEvent<C>
Source§impl<C: IOCallback> Deref for IOEvent<C>
impl<C: IOCallback> Deref for IOEvent<C>
Auto Trait Implementations§
impl<C> Freeze for IOEvent<C>
impl<C> !RefUnwindSafe for IOEvent<C>
impl<C> Send for IOEvent<C>
impl<C> !Sync for IOEvent<C>
impl<C> Unpin for IOEvent<C>
impl<C> !UnwindSafe for IOEvent<C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more