Trait cvt_trait::Cvt[][src]

pub trait Cvt: Sealed {
    fn cvt(self) -> Result<Self::Output>;
}
Expand description

The main trait in this crate.

See also the example in the crate-level documentation.

Required methods

Converts the “numeric” result returned by the native operating system’s C API to io::Result.

Implementations on Foreign Types

Implementation for i32, which is generally std::os::raw::c_int.

Returns Err(io::Error::last_os_error()) if self is -1, Ok(self) otherwise.

Implementation for i64. Sometimes i64 is std::os::raw::c_long.

Returns Err(io::Error::last_os_error()) if self is -1, Ok(self) otherwise.

Implementation for ssize_t, which is the return type of functions like read(2).

Returns Err(io::Error::last_os_error()) if self is -1, Ok(self) otherwise.

Implementors