fuse_opt

Struct fuse_opt 

Source
#[repr(C)]
pub struct fuse_opt { pub templ: *const c_char, pub offset: c_ulong, pub value: c_int, }
Expand description

Option description

This structure describes a single option, and and action associated with it, in case it matches.

More than one such match may occur, in which case the action for each match is executed.

There are three possible actions in case of a match:

i) An integer (int or unsigned) variable determined by ‘offset’ is set to ‘value’

ii) The processing function is called, with ‘value’ as the key

iii) An integer (any) or string (char *) variable determined by ‘offset’ is set to the value of an option parameter

‘offset’ should normally be either set to

  • ‘offsetof(struct foo, member)’ actions i) and iii)

  • -1 action ii)

The ‘offsetof()’ macro is defined in the <stddef.h> header.

The template determines which options match, and also have an effect on the action. Normally the action is either i) or ii), but if a format is present in the template, then action iii) is performed.

The types of templates are:

  1. “-x”, “-foo”, “–foo”, “–foo-bar”, etc. These match only themselves. Invalid values are “–” and anything beginning with “-o”

  2. “foo”, “foo-bar”, etc. These match “-ofoo”, “-ofoo-bar” or the relevant option in a comma separated option list

  3. “bar=”, “–foo=”, etc. These are variations of 1) and 2) which have a parameter

  4. “bar=%s”, “–foo=%lu”, etc. Same matching as above but perform action iii).

  5. “-x “, etc. Matches either “-xparam” or “-x param” as two separate arguments

  6. “-x %s”, etc. Combination of 4) and 5)

If the format is “%s”, memory is allocated for the string unlike with scanf().

Fields§

§templ: *const c_char

Matching template and optional parameter formatting

§offset: c_ulong

Offset of variable within ‘data’ parameter of fuse_opt_parse() or -1

§value: c_int

Value to set the variable to, or to be passed as ‘key’ to the processing function. Ignored if template has a format

Trait Implementations§

Source§

impl Clone for fuse_opt

Source§

fn clone(&self) -> fuse_opt

Returns a duplicate 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 fuse_opt

Source§

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

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

impl Copy for fuse_opt

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.