#[repr(C)]
pub struct _GOptionEntry { pub long_name: *const gchar, pub short_name: gchar, pub flags: gint, pub arg: GOptionArg, pub arg_data: gpointer, pub description: *const gchar, pub arg_description: *const gchar, }
Expand description

GOptionEntry: @long_name: The long name of an option can be used to specify it in a commandline as --long_name. Every option must have a long name. To resolve conflicts if multiple option groups contain the same long name, it is also possible to specify the option as --groupname-long_name. @short_name: If an option has a short name, it can be specified -short_name in a commandline. @short_name must be a printable ASCII character different from ‘-’, or zero if the option has no short name. @flags: Flags from #GOptionFlags @arg: The type of the option, as a #GOptionArg @arg_data: If the @arg type is %G_OPTION_ARG_CALLBACK, then @arg_data must point to a #GOptionArgFunc callback function, which will be called to handle the extra argument. Otherwise, @arg_data is a pointer to a location to store the value, the required type of the location depends on the @arg type: - %G_OPTION_ARG_NONE: %gboolean - %G_OPTION_ARG_STRING: %gchar* - %G_OPTION_ARG_INT: %gint - %G_OPTION_ARG_FILENAME: %gchar* - %G_OPTION_ARG_STRING_ARRAY: %gchar** - %G_OPTION_ARG_FILENAME_ARRAY: %gchar** - %G_OPTION_ARG_DOUBLE: %gdouble If @arg type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_FILENAME, the location will contain a newly allocated string if the option was given. That string needs to be freed by the callee using g_free(). Likewise if @arg type is %G_OPTION_ARG_STRING_ARRAY or %G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev(). @description: the description for the option in --help output. The @description is translated using the @translate_func of the group, see g_option_group_set_translation_domain(). @arg_description: The placeholder to use for the extra argument parsed by the option in --help output. The @arg_description is translated using the @translate_func of the group, see g_option_group_set_translation_domain().

A GOptionEntry struct defines a single option. To have an effect, they must be added to a #GOptionGroup with g_option_context_add_main_entries() or g_option_group_add_entries().

Fields§

§long_name: *const gchar§short_name: gchar§flags: gint§arg: GOptionArg§arg_data: gpointer§description: *const gchar§arg_description: *const gchar

Trait Implementations§

source§

impl Clone for _GOptionEntry

source§

fn clone(&self) -> _GOptionEntry

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 _GOptionEntry

source§

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

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

impl Copy for _GOptionEntry

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> ToOwned for T
where T: Clone,

§

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

§

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.