[][src]Struct wasi_common::OsFile

pub struct OsFile { /* fields omitted */ }

A file backed by the operating system's file system. Dereferences to a RawOsHandle. Its impl of Handle uses Rust's std to implement all file descriptor operations.

Constructing OsFile

OsFile can currently only be constructed from std::fs::File using the std::convert::TryFrom trait:

use std::fs::OpenOptions;
use std::convert::TryFrom;
use wasi_common::OsFile;

let file = OpenOptions::new().read(true).open("some_file").unwrap();
let os_file = OsFile::try_from(file).unwrap();

Trait Implementations

impl Debug for OsFile[src]

impl Deref for OsFile[src]

type Target = RawOsHandle

The resulting type after dereferencing.

impl Handle for OsFile[src]

impl TryFrom<File> for OsFile[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl !RefUnwindSafe for OsFile

impl Send for OsFile

impl !Sync for OsFile

impl Unpin for OsFile

impl UnwindSafe for OsFile

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointee for T[src]

type Pointer = u32

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.