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§
Sourcefn read(
handle: *mut c_void,
userdata: *mut c_void,
buffer: FileBuffer<'_>,
) -> Result<()>
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
.
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.