Trait FileSystemSync

Source
pub trait FileSystemSync: FileSystem {
    // Required methods
    fn read(
        handle: *mut c_void,
        userdata: *mut c_void,
        buffer: FileBuffer<'_>,
    ) -> Result<()>;
    fn seek(
        handle: *mut c_void,
        userdata: *mut c_void,
        position: c_uint,
    ) -> Result<()>;
}
Expand description

A synchronous filesystem.

You should prefer implementing this trait over FileSystemAsync- it’s a lot easier to do.

Required Methods§

Source

fn read( handle: *mut c_void, userdata: *mut c_void, buffer: FileBuffer<'_>, ) -> Result<()>

Callback for reading from a file.

If the callback is from System::attach_filesystem, then the return value is ignored.

If there is not enough data to read the requested number of bytes, return fewer bytes in the bytesread parameter and and return Error::FileEof.

Source

fn seek( handle: *mut c_void, userdata: *mut c_void, position: c_uint, ) -> Result<()>

Callback for seeking within a file.

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§