Skip to main content

dope_sys/io/request/
complete.rs

1use std::os::fd;
2
3use o3::{base::num::bounded, buffer::bytes::bounded::MAX};
4
5use crate::Errno;
6
7/// Consumes completion authority with the exact native file result.
8pub trait Complete: Sized {
9    type Output;
10
11    fn opened(self, result: Result<fd::OwnedFd, Errno>) -> Self::Output;
12    fn write(self, result: Result<bounded::U32<0, { MAX as u32 }>, Errno>) -> Self::Output;
13    fn sync(self, result: Result<(), Errno>) -> Self::Output;
14}