pub struct Subprocess { /* private fields */ }
Expand description
GSubprocess
allows the creation of and interaction with child
processes.
Processes can be communicated with using standard GIO-style APIs (ie:
InputStream
, OutputStream
). There are GIO-style APIs
to wait for process termination (ie: cancellable and with an asynchronous
variant).
There is an API to force a process to terminate, as well as a race-free API for sending UNIX signals to a subprocess.
One major advantage that GIO brings over the core GLib library is
comprehensive API for asynchronous I/O, such
OutputStreamExt::splice_async()
. This makes GSubprocess
significantly more powerful and flexible than equivalent APIs in
some other languages such as the subprocess.py
included with Python. For example, using GSubprocess
one could
create two child processes, reading standard output from the first,
processing it, and writing to the input stream of the second, all
without blocking the main loop.
A powerful communicate()
API is provided similar to the
communicate()
method of subprocess.py
. This enables very easy
interaction with a subprocess that has been opened with pipes.
GSubprocess
defaults to tight control over the file descriptors open
in the child process, avoiding dangling-FD issues that are caused by
a simple fork()
/exec()
. The only open file descriptors in the
spawned process are ones that were explicitly specified by the
GSubprocess
API (unless G_SUBPROCESS_FLAGS_INHERIT_FDS
was
specified).
GSubprocess
will quickly reap all child processes as they exit,
avoiding ‘zombie processes’ remaining around for long periods of
time. wait()
can be used to wait for this to happen,
but it will happen even without the call being explicitly made.
As a matter of principle, GSubprocess
has no API that accepts
shell-style space-separated strings. It will, however, match the
typical shell behaviour of searching the PATH
for executables that do
not contain a directory separator in their name. By default, the PATH
of the current process is used. You can specify
G_SUBPROCESS_FLAGS_SEARCH_PATH_FROM_ENVP
to use the PATH
of the
launcher environment instead.
GSubprocess
attempts to have a very simple API for most uses (ie:
spawning a subprocess with arguments and support for most typical
kinds of input and output redirection). See Gio::Subprocess::new()
. The
SubprocessLauncher
API is provided for more complicated cases
(advanced types of redirection, environment variable manipulation,
change of working directory, child setup functions, etc).
A typical use of GSubprocess
will involve calling
Gio::Subprocess::new()
, followed by wait_async()
or
wait()
. After the process exits, the status can be
checked using functions such as has_exited()
(which
are similar to the familiar WIFEXITED
-style POSIX macros).
Note that as of GLib 2.82, creating a GSubprocess
causes the signal
SIGPIPE
to be ignored for the remainder of the program. If you are writing
a command-line utility that uses GSubprocess
, you may need to take into
account the fact that your program will not automatically be killed
if it tries to write to stdout
after it has been closed.
§Properties
§argv
Argument vector.
Writeable | Construct Only
§flags
Subprocess flags.
Writeable | Construct Only
§Implements
[trait@glib::ObjectExt
], InitableExt
GLib type: GObject with reference counted clone semantics.
Implementations§
Source§impl Subprocess
impl Subprocess
Sourcepub fn communicate_utf8_async<R: FnOnce(Result<(Option<GString>, Option<GString>), Error>) + 'static, C: IsA<Cancellable>>(
&self,
stdin_buf: Option<String>,
cancellable: Option<&C>,
callback: R,
)
pub fn communicate_utf8_async<R: FnOnce(Result<(Option<GString>, Option<GString>), Error>) + 'static, C: IsA<Cancellable>>( &self, stdin_buf: Option<String>, cancellable: Option<&C>, callback: R, )
pub fn communicate_utf8_future( &self, stdin_buf: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(Option<GString>, Option<GString>), Error>> + 'static>>
Source§impl Subprocess
impl Subprocess
Sourcepub fn newv(
argv: &[&OsStr],
flags: SubprocessFlags,
) -> Result<Subprocess, Error>
pub fn newv( argv: &[&OsStr], flags: SubprocessFlags, ) -> Result<Subprocess, Error>
Sourcepub fn communicate(
&self,
stdin_buf: Option<&Bytes>,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(Option<Bytes>, Option<Bytes>), Error>
pub fn communicate( &self, stdin_buf: Option<&Bytes>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(Option<Bytes>, Option<Bytes>), Error>
Communicate with the subprocess until it terminates, and all input and output has been completed.
If @stdin_buf is given, the subprocess must have been created with
SubprocessFlags::STDIN_PIPE
. The given data is fed to the
stdin of the subprocess and the pipe is closed (ie: EOF).
At the same time (as not to cause blocking when dealing with large
amounts of data), if SubprocessFlags::STDOUT_PIPE
or
SubprocessFlags::STDERR_PIPE
were used, reads from those
streams. The data that was read is returned in @stdout and/or
the @stderr.
If the subprocess was created with SubprocessFlags::STDOUT_PIPE
,
@stdout_buf will contain the data read from stdout. Otherwise, for
subprocesses not created with SubprocessFlags::STDOUT_PIPE
,
@stdout_buf will be set to None
. Similar provisions apply to
@stderr_buf and SubprocessFlags::STDERR_PIPE
.
As usual, any output variable may be given as None
to ignore it.
If you desire the stdout and stderr data to be interleaved, create
the subprocess with SubprocessFlags::STDOUT_PIPE
and
SubprocessFlags::STDERR_MERGE
. The merged result will be returned
in @stdout_buf and @stderr_buf will be set to None
.
In case of any error (including cancellation), false
will be
returned with @error set. Some or all of the stdin data may have
been written. Any stdout or stderr data that has been read will be
discarded. None of the out variables (aside from @error) will have
been set to anything in particular and should not be inspected.
In the case that true
is returned, the subprocess has exited and the
exit status inspection APIs (eg: g_subprocess_get_if_exited(),
g_subprocess_get_exit_status()) may be used.
You should not attempt to use any of the subprocess pipes after starting this function, since they may be left in strange states, even if the operation was cancelled. You should especially not attempt to interact with the pipes while the operation is in progress (either from another thread or if using the asynchronous version).
§stdin_buf
data to send to the stdin of the subprocess, or None
§cancellable
a #GCancellable
§Returns
true
if successful
§stdout_buf
data read from the subprocess stdout
§stderr_buf
data read from the subprocess stderr
Sourcepub fn communicate_async<P: FnOnce(Result<(Option<Bytes>, Option<Bytes>), Error>) + 'static>(
&self,
stdin_buf: Option<&Bytes>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn communicate_async<P: FnOnce(Result<(Option<Bytes>, Option<Bytes>), Error>) + 'static>( &self, stdin_buf: Option<&Bytes>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
pub fn communicate_future( &self, stdin_buf: Option<&Bytes>, ) -> Pin<Box_<dyn Future<Output = Result<(Option<Bytes>, Option<Bytes>), Error>> + 'static>>
Sourcepub fn communicate_utf8(
&self,
stdin_buf: Option<&str>,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(Option<GString>, Option<GString>), Error>
pub fn communicate_utf8( &self, stdin_buf: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(Option<GString>, Option<GString>), Error>
Like g_subprocess_communicate(), but validates the output of the process as UTF-8, and returns it as a regular NUL terminated string.
On error, @stdout_buf and @stderr_buf will be set to undefined values and should not be used.
§stdin_buf
data to send to the stdin of the subprocess, or None
§cancellable
a #GCancellable
§Returns
§stdout_buf
data read from the subprocess stdout
§stderr_buf
data read from the subprocess stderr
Sourcepub fn force_exit(&self)
pub fn force_exit(&self)
Use an operating-system specific method to attempt an immediate, forceful termination of the process. There is no mechanism to determine whether or not the request itself was successful; however, you can use g_subprocess_wait() to monitor the status of the process after calling this function.
On Unix, this function sends SIGKILL
.
Sourcepub fn exit_status(&self) -> i32
pub fn exit_status(&self) -> i32
Check the exit status of the subprocess, given that it exited normally. This is the value passed to the exit() system call or the return value from main.
This is equivalent to the system WEXITSTATUS macro.
It is an error to call this function before g_subprocess_wait() and
unless g_subprocess_get_if_exited() returned true
.
§Returns
the exit status
Sourcepub fn identifier(&self) -> Option<GString>
pub fn identifier(&self) -> Option<GString>
Sourcepub fn has_exited(&self) -> bool
pub fn has_exited(&self) -> bool
Sourcepub fn has_signaled(&self) -> bool
pub fn has_signaled(&self) -> bool
Sourcepub fn status(&self) -> i32
pub fn status(&self) -> i32
Gets the raw status code of the process, as from waitpid().
This value has no particular meaning, but it can be used with the macros defined by the system headers such as WIFEXITED. It can also be used with g_spawn_check_wait_status().
It is more likely that you want to use g_subprocess_get_if_exited() followed by g_subprocess_get_exit_status().
It is an error to call this function before g_subprocess_wait() has returned.
§Returns
the (meaningless) waitpid() exit status from the kernel
Sourcepub fn stderr_pipe(&self) -> Option<InputStream>
pub fn stderr_pipe(&self) -> Option<InputStream>
Gets the #GInputStream from which to read the stderr output of @self.
The process must have been created with SubprocessFlags::STDERR_PIPE
,
otherwise None
will be returned.
§Returns
the stderr pipe
Sourcepub fn stdin_pipe(&self) -> Option<OutputStream>
pub fn stdin_pipe(&self) -> Option<OutputStream>
Gets the #GOutputStream that you can write to in order to give data to the stdin of @self.
The process must have been created with SubprocessFlags::STDIN_PIPE
and
not SubprocessFlags::STDIN_INHERIT
, otherwise None
will be returned.
§Returns
the stdout pipe
Sourcepub fn stdout_pipe(&self) -> Option<InputStream>
pub fn stdout_pipe(&self) -> Option<InputStream>
Gets the #GInputStream from which to read the stdout output of @self.
The process must have been created with SubprocessFlags::STDOUT_PIPE
,
otherwise None
will be returned.
§Returns
the stdout pipe
Sourcepub fn is_successful(&self) -> bool
pub fn is_successful(&self) -> bool
Checks if the process was “successful”. A process is considered successful if it exited cleanly with an exit status of 0, either by way of the exit() system call or return from main().
It is an error to call this function before g_subprocess_wait() has returned.
§Returns
true
if the process exited cleanly with a exit status of 0
Sourcepub fn term_sig(&self) -> i32
pub fn term_sig(&self) -> i32
Get the signal number that caused the subprocess to terminate, given that it terminated due to a signal.
This is equivalent to the system WTERMSIG macro.
It is an error to call this function before g_subprocess_wait() and
unless g_subprocess_get_if_signaled() returned true
.
§Returns
the signal causing termination
Sourcepub fn send_signal(&self, signal_num: i32)
Available on non-Windows only.
pub fn send_signal(&self, signal_num: i32)
Sends the UNIX signal @signal_num to the subprocess, if it is still running.
This API is race-free. If the subprocess has terminated, it will not be signalled.
This API is not available on Windows.
§signal_num
the signal number to send
Sourcepub fn wait(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
pub fn wait( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
Synchronously wait for the subprocess to terminate.
After the process terminates you can query its exit status with functions such as g_subprocess_get_if_exited() and g_subprocess_get_exit_status().
This function does not fail in the case of the subprocess having abnormal termination. See g_subprocess_wait_check() for that.
Cancelling @cancellable doesn’t kill the subprocess. Call g_subprocess_force_exit() if it is desirable.
§cancellable
a #GCancellable
§Returns
Sourcepub fn wait_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn wait_async<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
pub fn wait_future( &self, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcepub fn wait_check(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
pub fn wait_check( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
Sourcepub fn wait_check_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn wait_check_async<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
pub fn wait_check_future( &self, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Trait Implementations§
Source§impl Clone for Subprocess
impl Clone for Subprocess
Source§impl Debug for Subprocess
impl Debug for Subprocess
Source§impl HasParamSpec for Subprocess
impl HasParamSpec for Subprocess
type ParamSpec = ParamSpecObject
Source§type SetValue = Subprocess
type SetValue = Subprocess
type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, Subprocess>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for Subprocess
impl Hash for Subprocess
Source§impl Ord for Subprocess
impl Ord for Subprocess
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Comparison for two GObjects.
Compares the memory addresses of the provided objects.
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl ParentClassIs for Subprocess
impl ParentClassIs for Subprocess
Source§impl<OT: ObjectType> PartialEq<OT> for Subprocess
impl<OT: ObjectType> PartialEq<OT> for Subprocess
Source§impl<OT: ObjectType> PartialOrd<OT> for Subprocess
impl<OT: ObjectType> PartialOrd<OT> for Subprocess
Source§impl StaticType for Subprocess
impl StaticType for Subprocess
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for Subprocess
impl IsA<Initable> for Subprocess
Auto Trait Implementations§
impl Freeze for Subprocess
impl RefUnwindSafe for Subprocess
impl !Send for Subprocess
impl !Sync for Subprocess
impl Unpin for Subprocess
impl UnwindSafe for Subprocess
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
T
. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
T
. Read moreSource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
T
. Read moreSource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
T
. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while upcast
will do many checks at compile-time already. downcast
will
perform the same checks at runtime as dynamic_cast
, but will also ensure some amount of
compile-time safety. Read moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
T
unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
&T
unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<O> InitableExt for O
impl<O> InitableExt for O
Source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
Source§impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>)
fn parent_instance_init<T>(instance: &mut InitializingObject<T>)
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
true
if the object is an instance of (can be cast to) T
.Source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass
of the object. Read moreSource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
T
. Read moreSource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
T
of the object. Read moreSource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
Source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
Source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
Source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
property_name
of the object and cast it to the type V. Read moreSource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name
of the object. Read moreSource§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name
of this object. Read moreSource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec
of the property property_name
of this object.Source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec
of the properties of this object.Source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
Source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
key
. Read moreSource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
key
. Read moreSource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
key
. Read moreSource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
key
. Read moreSource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
key
. Read moreSource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
key
. Read moreSource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
Source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
Source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
Source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
Source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name
on this object. Read moreSource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id
on this object. Read moreSource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name
on this object. Read moreSource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id
on this object. Read moreSource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name
on this object. Read moreSource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id
on this object. Read moreSource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_name
on this object. Read moreSource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_id
on this object. Read moreSource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
closure
to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
invoke_with_values
, or
invoke
when using Rust closures.Source§fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit
but takes Value
for the arguments.Source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>
Source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
Source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify
signal of the object. Read moreSource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify
signal of the object. Read moreSource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
notify
signal of the object. Read more