Trait FileLike

Source
pub trait FileLike: Send + Sync {
    // Required methods
    fn read(&self, buf: &mut [u8]) -> LinuxResult<usize>;
    fn write(&self, buf: &[u8]) -> LinuxResult<usize>;
    fn stat(&self) -> LinuxResult<Kstat>;
    fn into_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>;
    fn poll(&self) -> LinuxResult<PollState>;
    fn set_nonblocking(&self, nonblocking: bool) -> LinuxResult;

    // Provided methods
    fn from_fd(fd: c_int) -> LinuxResult<Arc<Self>>
       where Self: Sized + 'static { ... }
    fn add_to_fd_table(self) -> LinuxResult<c_int>
       where Self: Sized + 'static { ... }
}

Required Methods§

Source

fn read(&self, buf: &mut [u8]) -> LinuxResult<usize>

Source

fn write(&self, buf: &[u8]) -> LinuxResult<usize>

Source

fn stat(&self) -> LinuxResult<Kstat>

Source

fn into_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>

Source

fn poll(&self) -> LinuxResult<PollState>

Source

fn set_nonblocking(&self, nonblocking: bool) -> LinuxResult

Provided Methods§

Source

fn from_fd(fd: c_int) -> LinuxResult<Arc<Self>>
where Self: Sized + 'static,

Source

fn add_to_fd_table(self) -> LinuxResult<c_int>
where Self: Sized + 'static,

Implementors§