[−]Struct gio::SettingsSchemaSource
This is an opaque structure type. You may not access it directly.
Methods
impl SettingsSchemaSource[src]
pub fn new_from_directory<P: AsRef<Path>>(
directory: P,
parent: Option<&SettingsSchemaSource>,
trusted: bool
) -> Result<SettingsSchemaSource, Error>[src]
directory: P,
parent: Option<&SettingsSchemaSource>,
trusted: bool
) -> Result<SettingsSchemaSource, Error>
Attempts to create a new schema source corresponding to the contents of the given directory.
This function is not required for normal uses of Settings but it
may be useful to authors of plugin management systems.
The directory should contain a file called gschemas.compiled as
produced by the [glib-compile-schemas][glib-compile-schemas] tool.
If trusted is true then gschemas.compiled is trusted not to be
corrupted. This assumption has a performance advantage, but can result
in crashes or inconsistent behaviour in the case of a corrupted file.
Generally, you should set trusted to true for files installed by the
system and to false for files in the home directory.
In either case, an empty file or some types of corruption in the file will
result in glib::FileError::Inval being returned.
If parent is non-None then there are two effects.
First, if SettingsSchemaSource::lookup is called with the
recursive flag set to true and the schema can not be found in the
source, the lookup will recurse to the parent.
Second, any references to other schemas specified within this
source (ie: child or extends) references may be resolved
from the parent.
For this second reason, except in very unusual situations, the
parent should probably be given as the default schema source, as
returned by SettingsSchemaSource::get_default.
directory
the filename of a directory
parent
a SettingsSchemaSource, or None
trusted
true, if the directory is trusted
pub fn list_schemas(&self, recursive: bool) -> (Vec<GString>, Vec<GString>)[src]
Lists the schemas in a given source.
If recursive is true then include parent sources. If false then
only include the schemas from one source (ie: one directory). You
probably want true.
Non-relocatable schemas are those for which you can call
Settings::new. Relocatable schemas are those for which you must
use Settings::new_with_path.
Do not call this function from normal programs. This is designed for use by database editors, commandline tools, etc.
recursive
if we should recurse
non_relocatable
the list of non-relocatable schemas, in no defined order
relocatable
the list of relocatable schemas, in no defined order
pub fn lookup(&self, schema_id: &str, recursive: bool) -> Option<SettingsSchema>[src]
Looks up a schema with the identifier schema_id in self.
This function is not required for normal uses of Settings but it
may be useful to authors of plugin management systems or to those who
want to introspect the content of schemas.
If the schema isn't found directly in self and recursive is true
then the parent sources will also be checked.
If the schema isn't found, None is returned.
schema_id
a schema ID
recursive
true if the lookup should be recursive
Returns
a new SettingsSchema
pub fn get_default() -> Option<SettingsSchemaSource>[src]
Gets the default system schema source.
This function is not required for normal uses of Settings but it
may be useful to authors of plugin management systems or to those who
want to introspect the content of schemas.
If no schemas are installed, None will be returned.
The returned source may actually consist of multiple schema sources
from different directories, depending on which directories were given
in XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR. For this reason, all
lookups performed against the default source should probably be done
recursively.
Returns
the default schema source
Trait Implementations
impl Clone for SettingsSchemaSource
fn clone(&self) -> SettingsSchemaSource
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for SettingsSchemaSource[src]
impl Eq for SettingsSchemaSource[src]
impl Hash for SettingsSchemaSource[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for SettingsSchemaSource[src]
fn cmp(&self, other: &SettingsSchemaSource) -> Ordering[src]
#[must_use]
fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<SettingsSchemaSource> for SettingsSchemaSource[src]
fn eq(&self, other: &SettingsSchemaSource) -> bool[src]
fn ne(&self, other: &SettingsSchemaSource) -> bool[src]
impl PartialOrd<SettingsSchemaSource> for SettingsSchemaSource[src]
fn partial_cmp(&self, other: &SettingsSchemaSource) -> Option<Ordering>[src]
fn lt(&self, other: &SettingsSchemaSource) -> bool[src]
fn le(&self, other: &SettingsSchemaSource) -> bool[src]
fn gt(&self, other: &SettingsSchemaSource) -> bool[src]
fn ge(&self, other: &SettingsSchemaSource) -> bool[src]
impl StaticType for SettingsSchemaSource
fn static_type() -> Type
impl StructuralEq for SettingsSchemaSource[src]
impl StructuralPartialEq for SettingsSchemaSource[src]
Auto Trait Implementations
impl RefUnwindSafe for SettingsSchemaSource
impl !Send for SettingsSchemaSource
impl !Sync for SettingsSchemaSource
impl Unpin for SettingsSchemaSource
impl UnwindSafe for SettingsSchemaSource
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, [src]
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)[src]
t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
fn to_glib_container_from_slice(
_t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)[src]
_t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
fn to_glib_full_from_slice(_t: &[T]) -> *const GList[src]
impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, [src]
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)[src]
t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
fn to_glib_container_from_slice(
_t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)[src]
_t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
fn to_glib_full_from_slice(_t: &[T]) -> *const GPtrArray[src]
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, [src]
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)[src]
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)
fn to_glib_container_from_slice(
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)[src]
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GArray[src]
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, [src]
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)[src]
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
fn to_glib_container_from_slice(
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)[src]
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GList[src]
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, [src]
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)[src]
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
fn to_glib_container_from_slice(
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)[src]
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GPtrArray[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToValue for T where
T: SetValue + ?Sized, [src]
T: SetValue + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,