Expand description
§Rust GLib and GObject bindings
Rust bindings and wrappers for GLib, part of gtk-rs-core.
GLib 2.56 is the lowest supported version for the underlying library.
This library contains bindings to GLib and GObject types and APIs as well as common building blocks used in both handmade and machine generated bindings to GTK and other GLib-based libraries.
It is the foundation for higher level libraries with uniform Rusty (safe and strongly typed) APIs. It avoids exposing GLib-specific data types where possible and is not meant to provide comprehensive GLib bindings, which would often amount to duplicating the Rust Standard Library or other utility crates.
§Minimum supported Rust version
Currently, the minimum supported Rust version is 1.83.0.
§Dynamic typing
Most types in the GLib family have Type identifiers.
Their corresponding Rust types implement the StaticType trait.
A dynamically typed Value can carry values of any StaticType.
Variants can carry values of StaticVariantType.
§Errors
Errors are represented by Error, which can
carry values from various error domains such as
FileError.
§Objects
Each class and interface has a corresponding smart pointer struct
representing an instance of that type (e.g. Object for GObject or
gtk4::Widget for GtkWidget). They are reference counted and feature
interior mutability similarly to Rust’s
Rc<RefCell<T>>
idiom. Consequently, cloning objects is cheap and their methods never require
mutable borrows. Two smart pointers are equal if they point to the same
object.
The root of the object hierarchy is Object.
Inheritance and subtyping is denoted with the IsA
marker trait. The Cast trait enables upcasting
and downcasting.
Interfaces and non-leaf classes also have corresponding traits (e.g.
ObjectExt or WidgetExt), which are blanketly implemented for all
their subtypes.
You can create new subclasses of Object or other object types. Look at
the module’s documentation for further details and a code example.
§Under the hood
GLib-based libraries largely operate on pointers to various boxed or
reference counted structures so the bindings have to implement corresponding
smart pointers (wrappers), which encapsulate resource management and safety
checks. Such wrappers are defined via the
wrapper! macro, which uses abstractions
defined in the wrapper, boxed,
shared and object modules.
The translate module defines and partly implements
conversions between high level Rust types (including the aforementioned
wrappers) and their FFI counterparts.
§Documentation
§Using
We recommend using crates from crates.io, as demonstrated here.
If you want to track the bleeding edge, use the git dependency instead:
[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "glib" }Avoid mixing versioned and git crates like this:
# This will not compile
[dependencies]
glib = "0.13"
glib = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "glib" }§License
glib is available under the MIT License, please refer to it.
Re-exports§
pub use self::closure::Closure;pub use self::closure::RustClosure;pub use self::enums::EnumClass;pub use self::enums::EnumValue;pub use self::enums::FlagsBuilder;pub use self::enums::FlagsClass;pub use self::enums::FlagsValue;pub use self::enums::UserDirectory;pub use self::error::BoolError;pub use self::error::Error;pub use self::object::BorrowedObject;pub use self::object::Class;pub use self::object::InitiallyUnowned;pub use self::object::Interface;pub use self::object::Object;pub use self::object::SendWeakRef;pub use self::object::WeakRef;pub use self::signal::signal_handler_block;pub use self::signal::signal_handler_disconnect;pub use self::signal::signal_handler_unblock;pub use self::signal::signal_stop_emission_by_name;pub use self::signal::Propagation;pub use self::signal::SignalHandlerId;pub use self::types::ILong;pub use self::types::Pointer;pub use self::types::Type;pub use self::types::ULong;pub use self::value::BoxedValue;pub use self::value::SendValue;pub use self::value::Value;pub use self::variant::FixedSizeVariantArray;pub use self::variant::Variant;pub use self::FileError;pub use collections::List;pub use collections::PtrSlice;pub use collections::SList;pub use collections::Slice;pub use collections::StrV;pub use collections::StrVRef;pub use self::char::Char;pub use self::char::UChar;pub use self::match_info::MatchInfo;pub use bitflags;pub use glib_sys as ffi;pub use gobject_sys as gobject_ffi;pub use self::source::*;
Modules§
- boxed
IMPLBoxed wrapper implementation.- boxed_
inline IMPLBoxedInline wrapper implementation.- char
- clone
- closure
- collections
- enums
- error
Errorbinding and helper trait.- match_
info - object
IMPLObject wrapper implementation andObjectbinding.- prelude
- Traits and essential types intended for blanket imports.
- property
- regex
- This module is inefficient and should not be used by Rust programs except for compatibility with GLib.Regex based APIs.
- shared
IMPLShared (reference counted) wrapper implementation.- signal
IMPLLow level signal support.- source
- subclass
- Module containing infrastructure for subclassing
GObjects and registering boxed types. - thread_
guard - translate
- Translation between GLib/GLib-based FFI types and their Rust counterparts.
- types
- Runtime type information.
- value
Valuebinding and helper traits.- variant
Variantbinding and helper traits.- wrapper
IMPLThewrapper!macro and miscellaneous wrapper traits.
Macros§
- bool_
error - Generic error used for functions that fail without any further information
- clone
- Macro for passing variables as strong or weak references into a closure.
- closure
- Macro for creating a
Closureobject. This is a wrapper aroundClosure::newthat automatically type checks its arguments at run-time. - closure_
local - The same as
closure!but usesClosure::new_localas a constructor. This is useful for closures which can’t be sent across threads. See the documentation ofclosure!for details. - debug
log_macros - A macro which behaves exactly as
log::debug!except that it sets the current log target to the contents of aG_LOG_DOMAINconstant (and fails to build if not defined). - error
log_macros - A macro which behaves exactly as
log::error!except that it sets the current log target to the contents of aG_LOG_DOMAINconstant (and fails to build if not defined). - function_
name - This macro returns the name of the enclosing function.
As the internal implementation is based on the
std::any::type_name, this macro derives all the limitations of this function. - g_
critical - Macro used to log using GLib logging system. It uses g_log.
- g_debug
- Macro used to log using GLib logging system. It uses g_log.
- g_error
- Macro used to log using GLib logging system. It uses g_log.
- g_info
- Macro used to log using GLib logging system. It uses g_log.
- g_log
- Macro used to log using GLib logging system. It uses g_log.
- g_
message - Macro used to log using GLib logging system. It uses g_log.
- g_print
- Macro used to print messages. It uses g_print.
- g_
printerr - Macro used to print error messages. It uses g_printerr.
- g_
warning - Macro used to log using GLib logging system. It uses g_log.
- gformat
- Creates a
GStringusing interpolation of runtime expressions. - glib_
boxed_ inline_ wrapper - Wrapper implementations for BoxedInline types. See
wrapper!. - glib_
boxed_ wrapper - Wrapper implementations for Boxed types. See
wrapper!. - glib_
object_ wrapper - ObjectType implementations for Object types. See
wrapper!. - glib_
shared_ wrapper - Wrapper implementations for shared types. See
wrapper!. - gstr
- Converts a static string literal into a static nul-terminated string.
- info
log_macros - A macro which behaves exactly as
log::info!except that it sets the current log target to the contents of aG_LOG_DOMAINconstant (and fails to build if not defined). - log_
structured - Macro used to log using GLib structured logging system.
- result_
from_ gboolean - trace
log_macros - A macro which behaves exactly as
log::trace!except that it sets the current log target to the contents of aG_LOG_DOMAINconstant (and fails to build if not defined). - warn
log_macros - A macro which behaves exactly as
log::warn!except that it sets the current log target to the contents of aG_LOG_DOMAINconstant (and fails to build if not defined). - wrapper
- Defines a wrapper type and implements the appropriate traits.
Structs§
- Binding
GObjectinstance (or source) and another property on anotherGObjectinstance (or target).- Binding
Flags - Flags to be passed to
ObjectExt::bind_property()or [ObjectExt::bind_property_full()][crate::prelude::ObjectExt::bind_property_full()]. - Binding
Group v2_72 GBindingGroupcan be used to bind multiple properties from an object collectively.- Binding
Group Builder v2_72 - Builder for binding group bindings.
- Boxed
AnyObject - This is a subclass of
glib::object::Objectcapable of storing any Rust type. It let’s you insert a Rust type anywhere aglib::object::Objectis needed. The inserted value can then be borrowed as a Rust type, by using the various provided methods. - Byte
Array - Contains the public fields of a
GByteArray. Contains the public fields of aGByteArray. - Bytes
- A shared immutable byte slice (the equivalent of
Rc<[u8]>). - Checksum
- GLib provides a generic API for computing checksums (or ‘digests’) for a sequence of arbitrary bytes, using various hashing algorithms like MD5, SHA-1 and SHA-256. Checksums are commonly used in various environments and specifications.
- Collation
Key - A
CollationKeyallows ordering strings using the linguistically correct rules for the current locale. - Date
- GLib type: Inline allocated boxed type with stack copy semantics.
- Date
Time GDateTimeis a structure that combines a Gregorian date and time into a single structure.- Exit
Code - File
SetContents Flags v2_66 - Flags to pass to g_file_set_contents_full() to affect its safety and performance.
- Filename
Collation Key - A
FilenameCollationKeyallows ordering file names using the linguistically correct rules for the current locale. Compared toCollationKey, filename collation keys take into consideration dots and other characters commonly found in file names. - Format
Size Flags - Flags to modify the format of the string returned by g_format_size_full().
- Future
With Timeout Error futures - The error returned when a future times out.
- GStr
- Representation of a borrowed
GString. - GStr
Interior NulError - Error type indicating that a buffer had unexpected nul-bytes.
- GString
- A type representing an owned, C-compatible, nul-terminated UTF-8 string.
- GString
Builder - A mutable text buffer that grows automatically.
- GString
Interior NulError - Error type indicating that a buffer had unexpected nul-bytes.
- GString
NoTrailing NulError - Error type indicating that a buffer did not have a trailing nul-byte.
- GString
Ptr NULL-terminated UTF-8 string as stored inStrV.- GString
Utf8 Error - Error type indicating that a buffer had invalid UTF-8.
- Glib
Logger log - An implementation of a
logcompatible logger which logs over glib logging facilities. - IConv
- The GIConv struct wraps an iconv() conversion descriptor. It contains private data and should only be accessed using the following functions. The GIConv struct wraps an iconv() conversion descriptor. It contains private data and should only be accessed using the following functions.
- IOCondition
- A bitwise combination representing a condition to watch for on an event source.
- Interface
Info - A structure that provides information to the type system which is used specifically for managing interface types. A structure that provides information to the type system which is used specifically for managing interface types.
- Invalid
Exit Code - Join
Error futures - Task failure from awaiting a
JoinHandle. - Join
Handle futures - A handle to a task running on a
MainContext. - KeyFile
GKeyFileparses .ini-like config files.- KeyFile
Flags - Flags which influence the parsing.
- LogField
- Structure representing a single field in a structured log entry.
- LogHandler
Id - LogLevel
Flags - Flags specifying the level of log messages.
- LogLevels
- Main
Context - The
GMainContextstruct is an opaque data type representing a set of sources to be handled in a main loop. TheGMainContextstruct is an opaque data type representing a set of sources to be handled in a main loop. - Main
Context Acquire Guard - Main
Context Flags v2_72 - Flags to pass to
GLib::MainContext::new_with_flags()which affect the behaviour of aMainContext. - Main
Loop - The
GMainLoopstruct is an opaque data type representing the main event loop of a GLib or GTK application. TheGMainLoopstruct is an opaque data type representing the main event loop of a GLib or GTK application. - Markup
Parse Context - A parse context is used to parse a stream of bytes that you expect to contain marked-up text.
- Option
Flags - Flags which modify individual options.
- Param
Flags - Through the
ParamFlagsflag values, certain aspects of parameters can be configured. - Param
Spec GParamSpecencapsulates the metadata required to specify parameters, such asGObjectproperties.- Param
Spec Boolean - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Boolean Builder - Param
Spec Boxed - A
ParamSpecderived structure that contains the meta data for boxed properties. AParamSpecderived structure that contains the meta data for boxed properties. - Param
Spec Boxed Builder - Param
Spec Char - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Char Builder - Param
Spec Double - A
ParamSpecderived structure that contains the meta data for double properties. AParamSpecderived structure that contains the meta data for double properties. - Param
Spec Double Builder - Param
Spec Enum - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Enum Builder - Param
Spec Flags - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Flags Builder - Param
Spec Float - A
ParamSpecderived structure that contains the meta data for float properties. AParamSpecderived structure that contains the meta data for float properties. - Param
Spec Float Builder - Param
SpecG Type - A
ParamSpecderived structure that contains the meta data forGTypeproperties. AParamSpecderived structure that contains the meta data forGTypeproperties. - Param
SpecG Type Builder - Param
Spec Int - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Int64 - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Int64 Builder - Param
Spec IntBuilder - Param
Spec Long - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Long Builder - Param
Spec Object - A
ParamSpecderived structure that contains the meta data for object properties. AParamSpecderived structure that contains the meta data for object properties. - Param
Spec Object Builder - Param
Spec Override - A
ParamSpecderived structure that redirects operations to other types ofParamSpec. - Param
Spec Override Builder - Param
Spec Param - A
ParamSpecderived structure that contains the meta data forG_TYPE_PARAMproperties. AParamSpecderived structure that contains the meta data forG_TYPE_PARAMproperties. - Param
Spec Param Builder - Param
Spec Pointer - A
ParamSpecderived structure that contains the meta data for pointer properties. AParamSpecderived structure that contains the meta data for pointer properties. - Param
Spec Pointer Builder - Param
Spec String - A
ParamSpecderived structure that contains the meta data for string properties. AParamSpecderived structure that contains the meta data for string properties. - Param
Spec String Builder - Param
SpecU Char - GLib type: Shared boxed type with reference counted clone semantics.
- Param
SpecU Char Builder - Param
SpecU Int - GLib type: Shared boxed type with reference counted clone semantics.
- Param
SpecU Int64 - GLib type: Shared boxed type with reference counted clone semantics.
- Param
SpecU Int64 Builder - Param
SpecU IntBuilder - Param
SpecU Long - GLib type: Shared boxed type with reference counted clone semantics.
- Param
SpecU Long Builder - Param
Spec Unichar - GLib type: Shared boxed type with reference counted clone semantics.
- Param
Spec Unichar Builder - Param
Spec Value Array - A
ParamSpecderived structure that contains the meta data forGValueArrayproperties. AParamSpecderived structure that contains the meta data forGValueArrayproperties. - Param
Spec Value Array Builder - Param
Spec Variant - A
ParamSpecderived structure that contains the meta data forGVariantproperties. - Param
Spec Variant Builder - Quark
- Regex
- A
GRegexis a compiled form of a regular expression. - Regex
Compile Flags - Flags specifying compile-time options.
- Regex
Match Flags - Flags specifying match-time options.
- Signal
Flags - The signal flags are used to specify a signal’s behaviour. The signal flags are used to specify a signal’s behaviour.
- Signal
Group v2_74 GSignalGroupmanages a collection of signals on aGObject.- Source
- The
GSourcestruct is an opaque data type representing an event source. TheGSourcestruct is an opaque data type representing an event source. - Source
Future futures - Represents a
Futurearound aglib::Source. The future will be resolved once the source has provided a value - Source
Stream futures - Represents a
Streamaround aglib::Source. The stream will be provide all values that are provided by the source - Spawn
Flags - Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
- Spawn
Within Join Handle futures - Variant of
JoinHandlethat is returned fromMainContext::spawn_from_within. - Thread
Handle - A handle to a thread running on a
ThreadPool. - Thread
Pool - The
GThreadPoolstruct represents a thread pool. - Time
Span - A value representing an interval of time, in microseconds.
- Time
Zone - A
GTimeZonerepresents a time zone, at no particular point in time. - Type
Flags - Bit masks used to check or determine characteristics of a type. Bit masks used to check or determine characteristics of a type.
- Type
Info - This structure is used to provide the type system with the information required to initialize and destruct (finalize) a type’s class and its instances.
- Type
Module GTypeModuleprovides a simple implementation of theGTypePlugininterface.- Type
Plugin - An interface that handles the lifecycle of dynamically loaded types.
- Type
Value Table 'i': Integers, passed ascollect_values[].v_int'l': Longs, passed ascollect_values[].v_long'd': Doubles, passed ascollect_values[].v_double'p': Pointers, passed ascollect_values[].v_pointer- Uri
v2_66 - The
GUritype and related functions can be used to parse URIs into their components, and build valid URIs from individual components. - UriFlags
v2_66 - Flags that describe a URI.
- UriHide
Flags v2_66 - Flags describing what parts of the URI to hide in
g_uri_to_string_partial(). Note that
PASSWORDandAUTH_PARAMSwill only work if the #GUri was parsed with the corresponding flags. - UriParams
Flags v2_66 - Flags modifying the way parameters are handled by g_uri_parse_params() and #GUriParamsIter.
- Value
Array - GLib type: Boxed type with copy-on-clone semantics.
- Variant
Dict VariantDictis a mutable key/value store where the keys are always strings and the values areVariants.- Variant
Iter - Iterator over items in a variant.
- Variant
StrIter - Iterator over items in a variant of type
as. - Variant
Ty - Describes
Varianttypes. - Variant
TyIterator - An iterator over the individual components of a tuple VariantTy.
- Variant
Type - Describes
Varianttypes.
Enums§
- Character
Decomposition - The result of a single step of the Unicode canonical decomposition algorithm
- Checksum
Type - The hashing algorithm to be used by #GChecksum when performing the digest of some data.
- Control
Flow - Continue calling the closure in the future iterations or drop it.
- Convert
Error - Error codes returned by character set conversion routines.
- CvtError
- A wrapper for
ConvertErrorthat can hold an offset into the input string. - Date
Month - Enumeration representing a month; values are
January,February, etc.BadMonthis the invalid value. - Date
Weekday - Enumeration representing a day of the week;
Monday,Tuesday, etc.BadWeekdayis an invalid weekday. - Decomposition
Kind - The kind of decomposition to perform
- File
Error - Values corresponding to @errno codes returned from file operations on UNIX. Unlike @errno codes, GFileError values are available on all systems, even Windows. The exact meaning of each code depends on what sort of file operation you were performing; the UNIX documentation gives more details. The following error code descriptions come from the GNU C Library manual, and are under the copyright of that manual.
- GStr
Error - Error type holding all possible failures when creating a
GStrreference. - GString
From Error - Error type holding all possible failures when creating a
GString. - Glib
Logger Domain log - Enumeration of the possible domain handling behaviours for a
GlibLogger. - Glib
Logger Format log - Enumeration of the possible formatting behaviours for a
GlibLogger. - IConv
Error - A wrapper for
std::io::Errorthat can hold an offset into an input string. - KeyFile
Error - Error codes returned by key file parsing.
- LogLevel
- LogWriter
Output - Return values from #GLogWriterFuncs to indicate whether the given log entry was successfully handled by the writer, or whether there was an error in handling it (and hence a fallback writer should be used).
- Markup
Error - Error codes returned by markup parsing.
- Normalize
Mode - Defines how a Unicode string is transformed in a canonical form, standardizing such issues as whether a character with an accent is represented as a base character and combining accent or as a single precomposed character. Unicode strings should generally be normalized before comparing them.
- Option
Arg - The #GOptionArg enum values determine which type of extra argument the
options expect to find. If an option expects an extra argument, it can
be specified in several ways; with a short option:
-x arg, with a long option:--name argor combined in a single argument:--name=arg. - Seek
Type - An enumeration specifying the base position for a g_io_channel_seek_position() operation.
- Time
Type - Disambiguates a given time in two ways.
- Unicode
Break Type - These are the possible line break classifications.
- Unicode
Script - The #GUnicodeScript enumeration identifies different writing systems. The values correspond to the names as defined in the Unicode standard. The enumeration has been added in GLib 2.14, and is interchangeable with #PangoScript.
- Unicode
Type - These are the possible character classifications from the Unicode specification. See Unicode Character Database.
- UriError
v2_66 - Error codes returned by #GUri methods.
- Variant
Class - The range of possible top-level types of #GVariant instances.
Constants§
- CLONE_
MACRO_ LOG_ DOMAIN - This is the log domain used by the
clone!macro. If you want to use a custom logger (it prints to stdout by default), you can set your own logger using the correspondinglogfunctions. - NONE_
STR
Statics§
- CSET_
A_ 2_ Z - CSET_
DIGITS - CSET_
a_ 2_ z - KEY_
FILE_ DESKTOP_ GROUP - KEY_
FILE_ DESKTOP_ KEY_ ACTIONS - KEY_
FILE_ DESKTOP_ KEY_ CATEGORIES - KEY_
FILE_ DESKTOP_ KEY_ COMMENT - KEY_
FILE_ DESKTOP_ KEY_ DBUS_ ACTIVATABLE - KEY_
FILE_ DESKTOP_ KEY_ EXEC - KEY_
FILE_ DESKTOP_ KEY_ GENERIC_ NAME - KEY_
FILE_ DESKTOP_ KEY_ HIDDEN - KEY_
FILE_ DESKTOP_ KEY_ ICON - KEY_
FILE_ DESKTOP_ KEY_ MIME_ TYPE - KEY_
FILE_ DESKTOP_ KEY_ NAME - KEY_
FILE_ DESKTOP_ KEY_ NOT_ SHOW_ IN - KEY_
FILE_ DESKTOP_ KEY_ NO_ DISPLAY - KEY_
FILE_ DESKTOP_ KEY_ ONLY_ SHOW_ IN - KEY_
FILE_ DESKTOP_ KEY_ PATH - KEY_
FILE_ DESKTOP_ KEY_ STARTUP_ NOTIFY - KEY_
FILE_ DESKTOP_ KEY_ STARTUP_ WM_ CLASS - KEY_
FILE_ DESKTOP_ KEY_ TERMINAL - KEY_
FILE_ DESKTOP_ KEY_ TRY_ EXEC - KEY_
FILE_ DESKTOP_ KEY_ TYPE - KEY_
FILE_ DESKTOP_ KEY_ URL - KEY_
FILE_ DESKTOP_ KEY_ VERSION - KEY_
FILE_ DESKTOP_ TYPE_ APPLICATION - KEY_
FILE_ DESKTOP_ TYPE_ DIRECTORY - KEY_
FILE_ DESKTOP_ TYPE_ LINK - OPTION_
REMAINING - STR_
DELIMITERS - The standard delimiters, used in
strdelimit(). The standard delimiters, used instrdelimit(). - TEST_
OPTION_ ISOLATE_ DIRS v2_60 - A value that can be passed as an option to
test_init(). - TEST_
OPTION_ NONFATAL_ ASSERTIONS v2_84 - A value that can be passed as an option to
test_init(). - TEST_
OPTION_ NO_ PRGNAME v2_84 - A value that can be passed as an option to
test_init(). - URI_
RESERVED_ CHARS_ GENERIC_ DELIMITERS - Generic delimiters characters as defined in
RFC 3986. Includes
:/?#[]@. Generic delimiters characters as defined in RFC 3986. Includes:/?#[]@. - URI_
RESERVED_ CHARS_ SUBCOMPONENT_ DELIMITERS - Subcomponent delimiter characters as defined in
RFC 3986. Includes
!$&'()*+,;=. Subcomponent delimiter characters as defined in RFC 3986. Includes!$&'()*+,;=.
Traits§
- HasParam
Spec - HasParam
Spec Defaulted - IntoG
Str - A trait to accept both
&stror&GStras an argument. - Into
OptionalG Str - A trait to accept both
Option<&str>orOption<&GStr>as an argument. - Param
Spec Builder Ext - A trait implemented by the various
ParamSpecbuilder types. - Param
Spec Type - Unichar
- This trait provides access to Unicode character classification and manipulations functions provided by GLib that do not exist in the standard library
Functions§
- access
- application_
name - base64_
decode - base64_
encode - casefold
- charset
- Obtain the character set for the current locale.
- check_
version - child_
watch_ future futures - Create a
Futurethat will resolve once the child process with the given pid exits - child_
watch_ future_ with_ priority futures - Create a
Futurethat will resolve once the child process with the given pid exits - codeset
- compute_
checksum_ for_ bytes - compute_
checksum_ for_ data - compute_
checksum_ for_ string - compute_
hmac_ for_ bytes - compute_
hmac_ for_ data - console_
charset v2_62 - convert
- convert_
with_ fallback - current_
dir - dcgettext
- dgettext
- dngettext
- dpgettext
- dpgettext2
- environ
- environ_
getenv - file_
get_ contents - file_
open_ tmp Unix - file_
set_ contents - file_
set_ contents_ full v2_66 - filename_
charsets - filename_
display_ basename - filename_
display_ name - filename_
from_ uri - filename_
from_ utf8 - filename_
to_ uri - filename_
to_ utf8 - find_
program_ in_ path - format_
size - format_
size_ full - future_
with_ timeout futures - Add a timeout to a
Future. - future_
with_ timeout_ with_ priority futures - Add a timeout to a
Future. - getenv
- home_
dir - host_
name - hostname_
is_ ascii_ encoded - hostname_
is_ ip_ address - hostname_
is_ non_ ascii - hostname_
to_ ascii - hostname_
to_ unicode - interval_
stream futures - Create a
Streamthat will provide a value every given number of milliseconds. - interval_
stream_ seconds futures - Create a
Streamthat will provide a value every given number of seconds. - interval_
stream_ seconds_ with_ priority futures - Create a
Streamthat will provide a value every given number of seconds. - interval_
stream_ with_ priority futures - Create a
Streamthat will provide a value every given number of milliseconds. - is_
canonical_ pspec_ name - language_
names - language_
names_ with_ category v2_58 - listenv
- locale_
from_ utf8 - locale_
to_ utf8 - locale_
variants - log_
default_ handler - log_
remove_ handler - log_
set_ always_ fatal - log_
set_ default_ handler - To set back the default print handler, use the
log_unset_default_handlerfunction. - log_
set_ fatal_ mask - log_
set_ handler - log_
set_ writer_ func - log_
structured_ array - log_
unset_ default_ handler - To set the default print handler, use the
log_set_default_handlerfunction. - log_
variant - log_
writer_ default - log_
writer_ ⚠default_ set_ use_ stderr v2_68 - Sets whether GLib log functions output to stderr or stdout.
- log_
writer_ default_ would_ drop v2_68 - log_
writer_ format_ fields - log_
writer_ is_ journald Unix - log_
writer_ journald - log_
writer_ standard_ streams - log_
writer_ supports_ color Unix - main_
current_ source - main_
depth - markup_
escape_ text - mkdir_
with_ parents - mkdtemp
- mkdtemp_
full - mkstemp
- mkstemp_
full - monotonic_
time - normalize
- num_
processors - on_
error_ query - on_
error_ stack_ trace - os_info
v2_64 - prgname
- program_
name - Same as
get_prgname(). - random_
double - random_
double_ range - random_
int - random_
int_ range - random_
set_ seed - real_
name - real_
time - reload_
user_ special_ dirs_ cache - rust_
log_ handler log - Provides a glib log handler which routes all logging messages to the
log crate. - rust_
log_ writer log - Provides a glib log writer which routes all structured logging messages to the
log crate. - set_
application_ name - set_
prgname - set_
print_ handler - To set back the default print handler, use the
unset_print_handlerfunction. - set_
printerr_ handler - To set back the default print handler, use the
unset_printerr_handlerfunction. - set_
program_ name - Same as
set_prgname(). - setenv
- shell_
parse_ argv - shell_
quote - shell_
unquote - spaced_
primes_ closest - spawn_
async - spawn_
async_ with_ fds v2_58and non-Windows - spawn_
async_ with_ pipes Non-Windows - spawn_
check_ exit_ status Deprecated - spawn_
check_ wait_ status v2_70 - spawn_
command_ line_ async Unix - spawn_
future futures - Spawn a new infallible
Futureon the thread-default main context. - spawn_
future_ local futures - Spawn a new infallible
Futureon the thread-default main context. - system_
config_ dirs - system_
data_ dirs - timeout_
future futures - Create a
Futurethat will resolve after the given number of milliseconds. - timeout_
future_ seconds futures - Create a
Futurethat will resolve after the given number of seconds. - timeout_
future_ seconds_ with_ priority futures - Create a
Futurethat will resolve after the given number of seconds. - timeout_
future_ with_ priority futures - Create a
Futurethat will resolve after the given number of milliseconds. - tmp_dir
- unlink
- unset_
print_ handler - To set the default print handler, use the
set_print_handlerfunction. - unset_
printerr_ handler - To set the default print handler, use the
set_printerr_handlerfunction. - unsetenv
- uri_
escape_ string - uri_
parse_ scheme - uri_
unescape_ segment - uri_
unescape_ string - user_
cache_ dir - user_
config_ dir - user_
data_ dir - user_
name - user_
runtime_ dir - user_
special_ dir - user_
state_ dir v2_72 - usleep
- utf8_
to_ utf32 - utf32_
to_ utf8 - uuid_
string_ is_ valid - uuid_
string_ random
Type Aliases§
Attribute Macros§
- async_
test - An attribute macro for writing asynchronous test functions.
- derived_
properties - When applied to
ObjectImpl - flags
- Attribute macro for defining flags using the
bitflagscrate. This macro will also define aGFlags::type_function and theglib::Valuetraits. - object_
interface - Macro for boilerplate of
ObjectInterfaceimplementations. - object_
subclass - Macro for boilerplate of
ObjectSubclassimplementations.
Derive Macros§
- Boxed
- Derive macro for defining a
BoxedType::type_function and theglib::Valuetraits. Optionally, the type can be marked asnullableto get an implementation ofglib::value::ToValueOptional. - Downgrade
- Macro for deriving implementations of
glib::clone::Downgradeandglib::clone::Upgradetraits and a weak type. - Enum
- Derive macro to register a Rust enum in the GLib type system and derive the
glib::Valuetraits. - Error
Domain - Derive macro for defining a GLib error domain and its associated
ErrorDomaintrait. - Properties
- This macro enables you to derive object properties in a quick way.
- Shared
Boxed - Derive macro for defining a
SharedType::get_typefunction and theglib::Valuetraits. Optionally, the type can be marked asnullableto get an implementation ofglib::value::ToValueOptional. - Value
Delegate - Example
- Variant
- Derive macro for serializing/deserializing custom structs/enums as
glib::Variants.