Crate glib[][src]

Expand description

Rust GLib and GObject bindings

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.

GLib 2.48 is the lowest supported version for the underlying library.

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 gtk::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 gtk::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.

Re-exports

pub use ffi;
pub use gobject_ffi;
pub use self::closure::Closure;
pub use self::error::BoolError;
pub use self::error::Error;
pub use self::object::Cast;
pub use self::object::Class;
pub use self::object::InitiallyUnowned;
pub use self::object::Interface;
pub use self::object::IsA;
pub use self::object::Object;
pub use self::object::ObjectExt;
pub use self::object::ObjectType;
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::SignalHandlerId;
pub use self::types::ILong;
pub use self::types::StaticType;
pub use self::types::Type;
pub use self::types::ULong;
pub use self::value::BoxedValue;
pub use self::value::SendValue;
pub use self::value::ToSendValue;
pub use self::value::ToValue;
pub use self::value::Value;
pub use self::variant::FromVariant;
pub use self::variant::StaticVariantType;
pub use self::variant::ToVariant;
pub use self::variant::Variant;
pub use self::char::*;
pub use self::source::*;
pub use self::send_unique::SendUnique;
pub use self::send_unique::SendUniqueCell;

Modules

boxed

IMPL Boxed wrapper implementation.

char
clone
closure
error

Error binding and helper trait.

functions
object

IMPL Object wrapper implementation and Object binding.

prelude

Traits and essential types intended for blanket imports.

send_unique
shared

IMPL Shared (reference counted) wrapper implementation.

signal

IMPL Low level signal support.

source
subclass

Module containing infrastructure for subclassing GObjects and registering boxed types.

translate

Translation between GLib/GLib-based FFI types and their Rust counterparts.

types

Runtime type information.

value

Value binding and helper traits.

variant

Variant binding and helper traits.

wrapper

IMPL The wrapper! 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.

debuglog_macros

A macro which behaves exactly as log::debug! except that it sets the current log target to the contents of a G_LOG_DOMAIN constant (and fails to build if not defined).

errorlog_macros

A macro which behaves exactly as log::error! except that it sets the current log target to the contents of a G_LOG_DOMAIN constant (and fails to build if not defined).

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.

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!.

infolog_macros

A macro which behaves exactly as log::info! except that it sets the current log target to the contents of a G_LOG_DOMAIN constant (and fails to build if not defined).

result_from_gboolean
tracelog_macros

A macro which behaves exactly as log::trace! except that it sets the current log target to the contents of a G_LOG_DOMAIN constant (and fails to build if not defined).

warnlog_macros

A macro which behaves exactly as log::warn! except that it sets the current log target to the contents of a G_LOG_DOMAIN constant (and fails to build if not defined).

wrapper

Defines a wrapper type and implements the appropriate traits.

Structs

Array
Binding

Binding is the representation of a binding between a property on a Object instance (or source) and another property on another Object instance (or target). Whenever the source property changes, the same value is applied to the target property; for instance, the following binding:

BindingFlags

Flags to be passed to [ObjectExtManual::bind_property()][crate::prelude::ObjectExtManual::bind_property()] or [ObjectExtManual::bind_property_full()][crate::prelude::ObjectExtManual::bind_property_full()].

ByteArray

Contains the public fields of a GByteArray.

Bytes

A shared immutable byte slice (the equivalent of Rc<[u8]>).

Checksum

An opaque structure representing a checksumming operation. To create a new GChecksum, use new(). To free a GChecksum, use g_checksum_free().

Date
DateTime

GDateTime is an opaque structure whose members cannot be accessed directly.

EnumClass

Representation of an enum for dynamically, at runtime, querying the values of the enum and using them.

EnumValue

Representation of a single enum value of an EnumClass.

FileSetContentsFlags

Flags to pass to file_set_contents_full() to affect its safety and performance.

FileTest

A test to perform on a file using file_test().

FlagsBuilder

Builder for conveniently setting/unsetting flags and returning a Value.

FlagsClass

Representation of a flags for dynamically, at runtime, querying the values of the enum and using them

FlagsValue

Representation of a single flags value of a FlagsClass.

FormatSizeFlags

Flags to modify the format of the string returned by format_size_full().

GString
GlibLogger

An implementation of a log compatible logger which logs over glib logging facilities.

IOCondition

A bitwise combination representing a condition to watch for on an event source.

KeyFile

The GKeyFile struct contains only private data and should not be accessed directly.

KeyFileFlags

Flags which influence the parsing.

LogHandlerId
LogLevelFlags

Flags specifying the level of log messages.

LogLevels
MainContext

The GMainContext struct is an opaque data type representing a set of sources to be handled in a main loop.

MainLoop

The GMainLoop struct is an opaque data type representing the main event loop of a GLib or GTK+ application.

OptionFlags

Flags which modify individual options.

ParamFlags

Through the ParamFlags flag values, certain aspects of parameters can be configured. See also G_PARAM_STATIC_STRINGS.

ParamSpec
ParamSpecBoolean
ParamSpecBoxed
ParamSpecChar
ParamSpecDouble
ParamSpecEnum
ParamSpecFlags
ParamSpecFloat
ParamSpecGType
ParamSpecInt
ParamSpecInt64
ParamSpecLong
ParamSpecObject
ParamSpecOverride
ParamSpecParam
ParamSpecPointer
ParamSpecString
ParamSpecUChar
ParamSpecUInt
ParamSpecUInt64
ParamSpecULong
ParamSpecUnichar
ParamSpecValueArray
ParamSpecVariant
Quark
Receiver

A Receiver that can be attached to a main context to receive items from its corresponding Sender or SyncSender.

Sender

A Sender that can be used to send items to the corresponding main context receiver.

SignalFlags

The signal flags are used to specify a signal’s behaviour, the overall signal description outlines how especially the RUN flags control the stages of a signal emission.

Source

The GSource struct is an opaque data type representing an event source.

SourceFuture

Represents a Future around a glib::Source. The future will be resolved once the source has provided a value

SourceStream

Represents a Stream around a glib::Source. The stream will be provide all values that are provided by the source

SpawnFlags

Flags passed to g_spawn_sync(), spawn_async() and g_spawn_async_with_pipes().

String

A mutable text buffer that grows automatically.

SyncSender

A SyncSender that can be used to send items to the corresponding main context receiver.

ThreadPool
TimeZone

TimeZone is an opaque structure whose members cannot be accessed directly.

Uri

The Uri type and related functions can be used to parse URIs into their components, and build valid URIs from individual components.

UriFlags

Flags that describe a URI.

UriHideFlags

Flags describing what parts of the URI to hide in Uri::to_string_partial(). Note that PASSWORD and AUTH_PARAMS will only work if the Uri was parsed with the corresponding flags.

UriParamsFlags

Flags modifying the way parameters are handled by g_uri_parse_params() and GUriParamsIter.

ValueArray
VariantDict

VariantDict is a mutable key/value store where the keys are always strings and the values are Variants.

VariantIter

Iterator over items in a variant.

VariantTy

Describes Variant types.

VariantType

Describes Variant types.

Enums

ChecksumType

The hashing algorithm to be used by Checksum when performing the digest of some data.

DateMonth

Enumeration representing a month; values are January, February, etc. BadMonth is the invalid value.

DateWeekday

Enumeration representing a day of the week; Monday, Tuesday, etc. BadWeekday is an invalid weekday.

FileError
GlibLoggerDomain

Enumeration of the possible domain handling behaviours for a GlibLogger.

GlibLoggerFormat

Enumeration of the possible formatting behaviours for a GlibLogger.

KeyFileError

Error codes returned by key file parsing.

LogLevel
OptionArg

The OptionArg 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 arg or combined in a single argument: --name=arg.

SeekType

An enumeration specifying the base position for a g_io_channel_seek_position() operation.

TimeType

Disambiguates a given time in two ways.

UriErrorv2_66

Error codes returned by Uri methods.

UserDirectory

These are logical ids for special directories which are defined depending on the platform used. You should use user_special_dir() to retrieve the full path associated to the logical id.

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 corresponding log functions.

Statics

CSET_A_2_Z

The set of uppercase ASCII alphabet characters. Used for specifying valid identifier characters in GScannerConfig.

CSET_DIGITS

The set of ASCII digits. Used for specifying valid identifier characters in GScannerConfig.

CSET_a_2_z

The set of lowercase ASCII alphabet characters. Used for specifying valid identifier characters in GScannerConfig.

KEY_FILE_DESKTOP_GROUP

The name of the main group of a desktop entry file, as defined in the Desktop Entry Specification. Consult the specification for more details about the meanings of the keys below.

KEY_FILE_DESKTOP_KEY_ACTIONS

A key under KEY_FILE_DESKTOP_GROUP, whose value is a string list giving the available application actions.

KEY_FILE_DESKTOP_KEY_CATEGORIES

A key under KEY_FILE_DESKTOP_GROUP, whose value is a list of strings giving the categories in which the desktop entry should be shown in a menu.

KEY_FILE_DESKTOP_KEY_COMMENT

A key under KEY_FILE_DESKTOP_GROUP, whose value is a localized string giving the tooltip for the desktop entry.

KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE

A key under KEY_FILE_DESKTOP_GROUP, whose value is a boolean set to true if the application is D-Bus activatable.

KEY_FILE_DESKTOP_KEY_EXEC

A key under KEY_FILE_DESKTOP_GROUP, whose value is a string giving the command line to execute. It is only valid for desktop entries with the Application type.

KEY_FILE_DESKTOP_KEY_GENERIC_NAME

A key under KEY_FILE_DESKTOP_GROUP, whose value is a localized string giving the generic name of the desktop entry.

KEY_FILE_DESKTOP_KEY_HIDDEN

A key under KEY_FILE_DESKTOP_GROUP, whose value is a boolean stating whether the desktop entry has been deleted by the user.

KEY_FILE_DESKTOP_KEY_ICON

A key under KEY_FILE_DESKTOP_GROUP, whose value is a localized string giving the name of the icon to be displayed for the desktop entry.

KEY_FILE_DESKTOP_KEY_MIME_TYPE

A key under KEY_FILE_DESKTOP_GROUP, whose value is a list of strings giving the MIME types supported by this desktop entry.

KEY_FILE_DESKTOP_KEY_NAME

A key under KEY_FILE_DESKTOP_GROUP, whose value is a localized string giving the specific name of the desktop entry.

KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN

A key under KEY_FILE_DESKTOP_GROUP, whose value is a list of strings identifying the environments that should not display the desktop entry.

KEY_FILE_DESKTOP_KEY_NO_DISPLAY

A key under KEY_FILE_DESKTOP_GROUP, whose value is a boolean stating whether the desktop entry should be shown in menus.

KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN

A key under KEY_FILE_DESKTOP_GROUP, whose value is a list of strings identifying the environments that should display the desktop entry.

KEY_FILE_DESKTOP_KEY_PATH

A key under KEY_FILE_DESKTOP_GROUP, whose value is a string containing the working directory to run the program in. It is only valid for desktop entries with the Application type.

KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY

A key under KEY_FILE_DESKTOP_GROUP, whose value is a boolean stating whether the application supports the Startup Notification Protocol Specification.

KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS

A key under KEY_FILE_DESKTOP_GROUP, whose value is string identifying the WM class or name hint of a window that the application will create, which can be used to emulate Startup Notification with older applications.

KEY_FILE_DESKTOP_KEY_TERMINAL

A key under KEY_FILE_DESKTOP_GROUP, whose value is a boolean stating whether the program should be run in a terminal window. It is only valid for desktop entries with the Application type.

KEY_FILE_DESKTOP_KEY_TRY_EXEC

A key under KEY_FILE_DESKTOP_GROUP, whose value is a string giving the file name of a binary on disk used to determine if the program is actually installed. It is only valid for desktop entries with the Application type.

KEY_FILE_DESKTOP_KEY_TYPE

A key under KEY_FILE_DESKTOP_GROUP, whose value is a string giving the type of the desktop entry. Usually KEY_FILE_DESKTOP_TYPE_APPLICATION, KEY_FILE_DESKTOP_TYPE_LINK, or KEY_FILE_DESKTOP_TYPE_DIRECTORY.

KEY_FILE_DESKTOP_KEY_URL

A key under KEY_FILE_DESKTOP_GROUP, whose value is a string giving the URL to access. It is only valid for desktop entries with the Link type.

KEY_FILE_DESKTOP_KEY_VERSION

A key under KEY_FILE_DESKTOP_GROUP, whose value is a string giving the version of the Desktop Entry Specification used for the desktop entry file.

KEY_FILE_DESKTOP_TYPE_APPLICATION

The value of the KEY_FILE_DESKTOP_KEY_TYPE, key for desktop entries representing applications.

KEY_FILE_DESKTOP_TYPE_DIRECTORY

The value of the KEY_FILE_DESKTOP_KEY_TYPE, key for desktop entries representing directories.

KEY_FILE_DESKTOP_TYPE_LINK

The value of the KEY_FILE_DESKTOP_KEY_TYPE, key for desktop entries representing links to documents.

OPTION_REMAINING

If a long option in the main group has this name, it is not treated as a regular option. Instead it collects all non-option arguments which would otherwise be left in argv. The option must be of type OptionArg::Callback, OptionArg::StringArray or OptionArg::FilenameArray.

STR_DELIMITERS

The standard delimiters, used in g_strdelimit().

TEST_OPTION_ISOLATE_DIRSv2_60

Creates a unique temporary directory for each unit test and uses g_set_user_dirs() to set XDG directories to point into subdirectories of it for the duration of the unit test. The directory tree is cleaned up after the test finishes successfully. Note that this doesn’t take effect until g_test_run() is called, so calls to (for example) g_get_user_home_dir() will return the system-wide value when made in a test program’s main() function.

URI_RESERVED_CHARS_GENERIC_DELIMITERS

Generic delimiters characters as defined in RFC 3986. Includes :/?#[]@.

URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS

Subcomponent delimiter characters as defined in RFC 3986. Includes !$&'()*+,;=.

g_param_spec_types

Traits

ParamSpecType

Functions

access
application_name
assert_warning
assertion_message
assertion_message_cmpstr
base64_decode
base64_encode
bit_nth_lsf
bit_nth_msf
bit_storage
build_filenamev

Behaves exactly like g_build_filename(), but takes the path elements as a string array, instead of varargs. This function is mainly meant for language bindings.

build_pathv

Behaves exactly like g_build_path(), but takes the path elements as a string array, instead of varargs. This function is mainly meant for language bindings.

canonicalize_filenamev2_58

Gets the canonical file name from filename. All triple slashes are turned into single slashes, and all .. and .s resolved against relative_to.

charset

Obtain the character set for the current locale.

chdir

A wrapper for the POSIX chdir() function. The function changes the current directory of the process to path.

check_version

Checks that the GLib library in use is compatible with the given version. Generally you would pass in the constants GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of GLib the application or module was compiled against.

child_watch_future

Create a Future that will resolve once the child process with the given pid exits

child_watch_future_with_priority

Create a Future that will resolve once the child process with the given pid exits

clear_error

If err or *err is None, does nothing. Otherwise, calls g_error_free() on *err and sets *err to None.

codeset
compute_checksum_for_bytes

Computes the checksum for a binary data. This is a convenience wrapper for Checksum::new(), Checksum::string() and g_checksum_free().

compute_checksum_for_data

Computes the checksum for a binary data of length. This is a convenience wrapper for Checksum::new(), Checksum::string() and g_checksum_free().

compute_checksum_for_string

Computes the checksum of a string.

compute_hmac_for_bytesv2_50

Computes the HMAC for a binary data. This is a convenience wrapper for g_hmac_new(), g_hmac_get_string() and g_hmac_unref().

compute_hmac_for_data

Computes the HMAC for a binary data of length. This is a convenience wrapper for g_hmac_new(), g_hmac_get_string() and g_hmac_unref().

compute_hmac_for_string

Computes the HMAC for a string.

console_charsetv2_62
current_dir
dcgettext
dgettext
dngettext
dpgettext
dpgettext2
environ
environ_getenv
file_get_contents
file_open_tmp
file_read_link
file_set_contents
file_set_contents_fullv2_66
file_test
filename_display_basename
filename_display_name
filename_from_uri
filename_to_uri
find_program_in_path
format_size
format_size_full
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

Create a Stream that will provide a value every given number of milliseconds.

interval_stream_seconds

Create a Stream that will provide a value every given number of seconds.

interval_stream_seconds_with_priority

Create a Stream that will provide a value every given number of seconds.

interval_stream_with_priority

Create a Stream that will provide a value every given number of milliseconds.

is_canonical_pspec_name
language_names
language_names_with_categoryv2_58
listenv
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_handler function.

log_set_fatal_mask
log_set_handler
log_unset_default_handler

To set the default print handler, use the log_set_default_handler function.

main_current_source
main_depth
markup_escape_text
mkdir_with_parents
mkdtemp
mkdtemp_full
mkstemp
mkstemp_full
monotonic_time
num_processors
on_error_query
on_error_stack_trace
os_infov2_64
path_get_basename
path_get_dirname
path_is_absolute
path_skip_root
pattern_match_simple
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
return_if_fail_warning
rmdir
rust_log_handler

Provides a glib log handler which routes all 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_handler function.

set_printerr_handler

To set back the default print handler, use the unset_printerr_handler function.

set_program_name

Same as set_prgname().

setenv
shell_parse_argv

Parses a command line into an argument vector, in much the same way the shell would, but without many of the expansions the shell would perform (variable expansion, globs, operators, filename expansion, etc. are not supported). The results are defined to be the same as those you would get from a UNIX98 /bin/sh, as long as the input contains none of the unsupported shell expansions. If the input does contain such expansions, they are passed through literally. Possible errors are those from the G_SHELL_ERROR domain. Free the returned vector with g_strfreev().

shell_quote

Quotes a string so that the shell (/bin/sh) will interpret the quoted string to mean unquoted_string. If you pass a filename to the shell, for example, you should first quote it with this function. The return value must be freed with g_free(). The quoting style used is undefined (single or double quotes may be used).

shell_unquote

Unquotes a string as the shell (/bin/sh) would. Only handles quotes; if a string contains file globs, arithmetic operators, variables, backticks, redirections, or other special-to-the-shell features, the result will be different from the result a real shell would produce (the variables, backticks, etc. will be passed through literally instead of being expanded). This function is guaranteed to succeed if applied to the result of shell_quote(). If it fails, it returns None and sets the error. The quoted_string need not actually contain quoted or escaped text; shell_unquote() simply goes through the string and unquotes/unescapes anything that the shell would. Both single and double quotes are handled, as are escapes including escaped newlines. The return value must be freed with g_free(). Possible errors are in the G_SHELL_ERROR domain.

spaced_primes_closest

Gets the smallest prime number from a built-in array of primes which is larger than num. This is used within GLib to calculate the optimum size of a GHashTable.

spawn_async

See g_spawn_async_with_pipes() for a full description; this function simply calls the g_spawn_async_with_pipes() without any pipes.

spawn_async_with_fdsv2_58 and non-Windows

Identical to g_spawn_async_with_pipes_and_fds() but with n_fds set to zero, so no FD assignments are used.

spawn_async_with_pipesNon-Windows

Identical to g_spawn_async_with_pipes_and_fds() but with n_fds set to zero, so no FD assignments are used.

spawn_check_exit_status

Set error if exit_status indicates the child exited abnormally (e.g. with a nonzero exit code, or via a fatal signal).

spawn_command_line_asyncUnix

A simple version of spawn_async() that parses a command line with shell_parse_argv() and passes it to spawn_async(). Runs a command line in the background. Unlike spawn_async(), the SpawnFlags::SEARCH_PATH flag is enabled, other flags are not. Note that SpawnFlags::SEARCH_PATH can have security implications, so consider using spawn_async() directly if appropriate. Possible errors are those from shell_parse_argv() and spawn_async().

stpcpy

Copies a nul-terminated string into the dest buffer, include the trailing nul, and return a pointer to the trailing nul byte. This is useful for concatenating multiple strings together without having to repeatedly scan for the end.

system_config_dirs
system_data_dirs
timeout_future

Create a Future that will resolve after the given number of milliseconds.

timeout_future_seconds

Create a Future that will resolve after the given number of seconds.

timeout_future_seconds_with_priority

Create a Future that will resolve after the given number of seconds.

timeout_future_with_priority

Create a Future that will resolve after the given number of milliseconds.

tmp_dir
unix_open_pipe

Similar to the UNIX pipe() call, but on modern systems like Linux uses the pipe2() system call, which atomically creates a pipe with the configured flags. The only supported flag currently is FD_CLOEXEC. If for example you want to configure O_NONBLOCK, that must still be done separately with fcntl().

unix_signal_futureUnix

Create a Future that will resolve once the given UNIX signal is raised

unix_signal_future_with_priorityUnix

Create a Future that will resolve once the given UNIX signal is raised

unix_signal_streamUnix

Create a Stream that will provide a value whenever the given UNIX signal is raised

unix_signal_stream_with_priorityUnix

Create a Stream that will provide a value whenever the given UNIX signal is raised

unlink

A wrapper for the POSIX unlink() function. The unlink() function deletes a name from the filesystem. If this was the last link to the file and no processes have it opened, the diskspace occupied by the file is freed.

unset_print_handler

To set the default print handler, use the set_print_handler function.

unset_printerr_handler

To set the default print handler, use the set_printerr_handler function.

unsetenv

Removes an environment variable from the environment.

user_cache_dir
user_config_dir
user_data_dir
user_name
user_runtime_dir
user_special_dir
usleep

Pauses the current thread for the given number of microseconds.

uuid_string_is_validv2_52

Parses the string str and verify if it is a UUID.

uuid_string_randomv2_52

Generates a random UUID (RFC 4122 version 4) as a string. It has the same randomness guarantees as GRand, so must not be used for cryptographic purposes such as key generation, nonces, salts or one-time pads.

warn_message

Internal function used to print messages from the public g_warn_if_reached() and g_warn_if_fail() macros.

Type Definitions

DateDay
DateYear
Time
TimeSpan

Attribute Macros

gflags

Attribute macro for defining flags using the bitflags crate. This macro will also define a GFlags::type_ function and the glib::Value traits.

object_interface

Macro for boilerplate of ObjectInterface implementations.

object_subclass

Macro for boilerplate of ObjectSubclass implementations.

Derive Macros

Downgrade

Macro for deriving implementations of glib::clone::Downgrade and glib::clone::Upgrade traits and a weak type.

GBoxed

Derive macro for defining a BoxedType::type_ function and the glib::Value traits.

GEnum
GErrorDomain

Derive macro for defining a GLib error domain and its associated ErrorDomain trait.

GSharedBoxed

Derive macro for defining a SharedType::get_type function and the glib::Value traits.