pub struct MergeSubmitter<C: IOCallback, S: BlockingTxTrait<Box<IOEvent<C>>>> { /* private fields */ }Expand description
Manages the submission of IO events, attempting to merge sequential events before sending them to the IO driver.
This component buffers incoming IOEvents into a MergeBuffer.
It ensures that events for the same file descriptor and IO action are
considered for merging to optimize system calls.
Implementations§
Source§impl<C: IOCallback, S: BlockingTxTrait<Box<IOEvent<C>>>> MergeSubmitter<C, S>
impl<C: IOCallback, S: BlockingTxTrait<Box<IOEvent<C>>>> MergeSubmitter<C, S>
Sourcepub fn add_event(&mut self, event: IOEvent<C>) -> Result<(), Error>
pub fn add_event(&mut self, event: IOEvent<C>) -> Result<(), Error>
Adds an IOEvent to the internal buffer, potentially triggering a flush.
If the event cannot be merged with current buffered events (e.g., non-contiguous,
exceeding merge limit), the existing buffered events are flushed first.
If adding the new event fills the buffer to its merge_size_limit, a flush is also triggered.
§Arguments
event- TheIOEventto add.
§Returns
An Ok(()) on success, or an io::Error if flushing fails.
On debug mode, will validate event.fd and event.action.
Auto Trait Implementations§
impl<C, S> Freeze for MergeSubmitter<C, S>where
S: Freeze,
impl<C, S> RefUnwindSafe for MergeSubmitter<C, S>where
S: RefUnwindSafe,
C: RefUnwindSafe,
impl<C, S> Send for MergeSubmitter<C, S>
impl<C, S> Sync for MergeSubmitter<C, S>
impl<C, S> Unpin for MergeSubmitter<C, S>where
S: Unpin,
impl<C, S> UnsafeUnpin for MergeSubmitter<C, S>where
S: UnsafeUnpin,
impl<C, S> UnwindSafe for MergeSubmitter<C, S>where
S: UnwindSafe,
C: UnwindSafe,
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