Trait FileSystem

Source
pub trait FileSystem {
    // Required methods
    fn open(
        name: &Utf8CStr,
        userdata: *mut c_void,
    ) -> Result<(*mut c_void, c_uint)>;
    fn close(handle: *mut c_void, userdata: *mut c_void) -> Result<()>;
}
Expand description

The base trait for all filesystems.

Required Methods§

Source

fn open(name: &Utf8CStr, userdata: *mut c_void) -> Result<(*mut c_void, c_uint)>

Callback for opening a file.

Return the appropriate error code such as Error::FileNotFound if the file fails to open. If the callback is from System::attach_filesystem, then the return value is ignored.

Source

fn close(handle: *mut c_void, userdata: *mut c_void) -> Result<()>

Callback for closing a file.

Close any user created file handle and perform any cleanup necessary for the file here. If the callback is from System::attach_filesystem, then the return value is ignored.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§