#[repr(C)]
pub struct vfs_file_system_ops { pub format: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>, pub mount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>, pub umount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>, pub rename: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, from_path: *const c_char, to_path: *const c_char) -> c_int>, pub unlink: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>, pub mkdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char, mode: mode_t) -> c_int>, pub rmdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>, pub stat: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut stat) -> c_int>, pub statvfs: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut statvfs) -> c_int>, }
Expand description

@brief Operations on mounted file systems

Similar, but not equal, to struct super_operations in Linux

Fields§

§format: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>

@brief Format the file system on the given mount point

@param[in] mountp file system to format

@return 0 on success @return <0 on error

§mount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>

@brief Perform any extra processing needed after mounting a file system

If this call returns an error, the whole vfs_mount call will signal a failure.

All fields of @p mountp will be initialized by vfs_mount beforehand, @c private_data will be initialized to NULL.

@param[in] mountp file system mount being mounted

@return 0 on success @return <0 on error

§umount: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t) -> c_int>

@brief Perform the necessary clean up for unmounting a file system

@param[in] mountp file system mount being unmounted

@return 0 on success @return <0 on error

§rename: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, from_path: *const c_char, to_path: *const c_char) -> c_int>

@brief Rename a file

The file @p from_path will be renamed to @p to_path

@note it is not possible to rename files across different file system

@param[in] mountp file system mount to operate on @param[in] from_path absolute path to existing file @param[in] to_path absolute path to destination

@return 0 on success @return <0 on error

§unlink: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>

@brief Unlink (delete) a file from the file system

@param[in] mountp file system mount to operate on @param[in] name name of the file to delete

@return 0 on success @return <0 on error

§mkdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char, mode: mode_t) -> c_int>

@brief Create a directory on the file system

@param[in] mountp file system mount to operate on @param[in] name name of the directory to create @param[in] mode file creation mode bits

@return 0 on success @return <0 on error

§rmdir: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, name: *const c_char) -> c_int>

@brief Remove a directory from the file system

Only empty directories may be removed.

@param[in] mountp file system mount to operate on @param[in] name name of the directory to remove

@return 0 on success @return <0 on error

§stat: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut stat) -> c_int>

@brief Get file status

@param[in] mountp file system mount to operate on @param[in] path path to file being queried @param[out] buf pointer to stat struct to fill

@return 0 on success @return <0 on error

§statvfs: Option<unsafe extern "C" fn(mountp: *mut vfs_mount_t, path: *const c_char, buf: *mut statvfs) -> c_int>

@brief Get file system status

@p path is only passed for consistency against the POSIX statvfs function. @c vfs_statvfs calls this function only when it has determined that @p path belongs to this file system. @p path is a file system relative path and does not necessarily name an existing file.

@param[in] mountp file system mount to operate on @param[in] path path to a file on the file system being queried @param[out] buf pointer to statvfs struct to fill

@return 0 on success @return <0 on error

Trait Implementations§

source§

impl Clone for vfs_file_system_ops

source§

fn clone(&self) -> vfs_file_system_ops

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for vfs_file_system_ops

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for vfs_file_system_ops

source§

fn default() -> vfs_file_system_ops

Returns the “default value” for a type. Read more
source§

impl Copy for vfs_file_system_ops

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.