Struct gio::SettingsSchemaKey

source ·
pub struct SettingsSchemaKey { /* private fields */ }
Expand description

SettingsSchemaKey is an opaque data structure and can only be accessed using the following functions.

Implementations§

source§

impl SettingsSchemaKey

source

pub fn as_ptr(&self) -> *mut GSettingsSchemaKey

Return the inner pointer to the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow<'a>( ptr: *const *const GSettingsSchemaKey ) -> &'a Self

Borrows the underlying C value.

source§

impl SettingsSchemaKey

source

pub fn default_value(&self) -> Variant

Gets the default value for self.

Note that this is the default value according to the schema. System administrator defaults and lockdown are not visible via this API.

Returns

the default value for the key

source

pub fn description(&self) -> Option<GString>

Gets the description for self.

If no description has been provided in the schema for self, returns None.

The description can be one sentence to several paragraphs in length. Paragraphs are delimited with a double newline. Descriptions can be translated and the value returned from this function is is the current locale.

This function is slow. The summary and description information for the schemas is not stored in the compiled schema database so this function has to parse all of the source XML files in the schema directory.

Returns

the description for self, or None

source

pub fn name(&self) -> GString

Gets the name of self.

Returns

the name of self.

source

pub fn range(&self) -> Variant

Queries the range of a key.

This function will return a glib::Variant that fully describes the range of values that are valid for self.

The type of glib::Variant returned is (sv). The string describes the type of range restriction in effect. The type and meaning of the value contained in the variant depends on the string.

If the string is 'type' then the variant contains an empty array. The element type of that empty array is the expected type of value and all values of that type are valid.

If the string is 'enum' then the variant contains an array enumerating the possible values. Each item in the array is a possible valid value and no other values are valid.

If the string is 'flags' then the variant contains an array. Each item in the array is a value that may appear zero or one times in an array to be used as the value for this key. For example, if the variant contained the array ['x', 'y'] then the valid values for the key would be [], ['x'], ['y'], ['x', 'y'] and ['y', 'x'].

Finally, if the string is 'range' then the variant contains a pair of like-typed values – the minimum and maximum permissible values for this key.

This information should not be used by normal programs. It is considered to be a hint for introspection purposes. Normal programs should already know what is permitted by their own schema. The format may change in any way in the future – but particularly, new forms may be added to the possibilities described above.

You should free the returned value with g_variant_unref() when it is no longer needed.

Returns

a glib::Variant describing the range

source

pub fn summary(&self) -> Option<GString>

Gets the summary for self.

If no summary has been provided in the schema for self, returns None.

The summary is a short description of the purpose of the key; usually one short sentence. Summaries can be translated and the value returned from this function is is the current locale.

This function is slow. The summary and description information for the schemas is not stored in the compiled schema database so this function has to parse all of the source XML files in the schema directory.

Returns

the summary for self, or None

source

pub fn value_type(&self) -> VariantType

Gets the glib::VariantType of self.

Returns

the type of self

source

pub fn range_check(&self, value: &Variant) -> bool

Checks if the given value is within the permitted range for self.

It is a programmer error if value is not of the correct type — you must check for this first.

value

the value to check

Returns

true if value is valid for self

Trait Implementations§

source§

impl Clone for SettingsSchemaKey

source§

fn clone(&self) -> Self

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 SettingsSchemaKey

source§

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

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

impl Display for SettingsSchemaKey

source§

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

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

impl From<SettingsSchemaKey> for Value

source§

fn from(s: SettingsSchemaKey) -> Self

Converts to this type from the input type.
source§

impl HasParamSpec for SettingsSchemaKey

§

type ParamSpec = ParamSpecBoxed

§

type SetValue = SettingsSchemaKey

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, SettingsSchemaKey>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for SettingsSchemaKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for SettingsSchemaKey

source§

fn cmp(&self, other: &SettingsSchemaKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for SettingsSchemaKey

source§

fn eq(&self, other: &SettingsSchemaKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for SettingsSchemaKey

source§

fn partial_cmp(&self, other: &SettingsSchemaKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for SettingsSchemaKey

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for SettingsSchemaKey

source§

impl StructuralEq for SettingsSchemaKey

source§

impl StructuralPartialEq for SettingsSchemaKey

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> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

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> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> TransparentType for T

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> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

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.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,