We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It should be a separate GPL workspace member. Rio can be used.
struct IoUring<S: AsRawFd> { ring: &Rio, sink: S, completion: Option<Completion>, current_buffer: Vec<u8>, completion_buffer: Vec<u8>, } impl<S: AsRawFd> Write for IoUring<S> { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { let new_len = self.current_buffer.len() + buf.len(); if self.current_buffer.capacity() < new_len { if let Some(completion) = self.completion.take() { completion.wait()?; } swap(self.current_buffer, self.completion_buffer); self.completion = Some(ring.write_at(&self.sink, &self.completion_buffer, at)); self.current_buffer.clear(); } self.current_buffer.extend_from_slice(buf); // maybe flush if full } fn flush(&mut self) -> io::Result<()> { if let Some(completion) = self.completion.take() { completion.wait()?; self.completion_buffer.clear(); } if !self.current_buffer.is_empty() { ring.write_at(&self.sink, & self.current_buffer, at).wait()?; self.current_buffer.clear(); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It should be a separate GPL workspace member.
Rio can be used.
The text was updated successfully, but these errors were encountered: