riot_sys

Struct vfs_file_system_ops

Source
#[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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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>,

Source§

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>,

Source§

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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 36 bytes