#[repr(transparent)]pub struct File { /* private fields */ }
Expand description
File
is a high level abstraction for manipulating files on a
virtual file system. GFiles
are lightweight, immutable objects
that do no I/O upon creation. It is necessary to understand that
File
objects do not represent files, merely an identifier for a
file. All file content I/O is implemented as streaming operations
(see InputStream
and OutputStream
).
To construct a File
, you can use:
for_path()
if you have a path.for_uri()
if you have a URI.for_commandline_arg()
for a command line argument.new_tmp()
to create a temporary file from a template.for_parse_name()
from a UTF-8 string gotten fromFileExt::parse_name()
.g_file_new_build_filename()
to create a file from path elements.
One way to think of a File
is as an abstraction of a pathname. For
normal files the system pathname is what is stored internally, but as
GFiles
are extensible it could also be something else that corresponds
to a pathname in a userspace implementation of a filesystem.
GFiles
make up hierarchies of directories and files that correspond to
the files on a filesystem. You can move through the file system with
File
using FileExt::parent()
to get an identifier for the parent
directory, FileExt::child()
to get a child within a directory,
FileExt::resolve_relative_path()
to resolve a relative path between two
GFiles
. There can be multiple hierarchies, so you may not end up at
the same root if you repeatedly call FileExt::parent()
on two different
files.
All GFiles
have a basename (get with FileExt::basename()
). These names
are byte strings that are used to identify the file on the filesystem
(relative to its parent directory) and there is no guarantees that they
have any particular charset encoding or even make any sense at all. If
you want to use filenames in a user interface you should use the display
name that you can get by requesting the
FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
attribute with FileExt::query_info()
.
This is guaranteed to be in UTF-8 and can be used in a user interface.
But always store the real basename or the File
to use to actually
access the file, because there is no way to go from a display name to
the actual name.
Using File
as an identifier has the same weaknesses as using a path
in that there may be multiple aliases for the same file. For instance,
hard or soft links may cause two different GFiles
to refer to the same
file. Other possible causes for aliases are: case insensitive filesystems,
short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
check if two GFiles
point to the same file you can query for the
FILE_ATTRIBUTE_ID_FILE
attribute. Note that File
does some trivial
canonicalization of pathnames passed in, so that trivial differences in
the path string used at creation (duplicated slashes, slash at end of
path, “.” or “..” path segments, etc) does not create different GFiles
.
Many File
operations have both synchronous and asynchronous versions
to suit your application. Asynchronous versions of synchronous functions
simply have _async()
appended to their function names. The asynchronous
I/O functions call a GAsyncReadyCallback
which is then used to finalize
the operation, producing a GAsyncResult which is then passed to the
function’s matching _finish()
operation.
It is highly recommended to use asynchronous calls when running within a shared main loop, such as in the main thread of an application. This avoids I/O operations blocking other sources on the main loop from being dispatched. Synchronous I/O operations should be performed from worker threads. See the [introduction to asynchronous programming section][async-programming] for more.
Some File
operations almost always take a noticeable amount of time, and
so do not have synchronous analogs. Notable cases include:
FileExt::mount_mountable()
to mount a mountable file.FileExt::unmount_mountable_with_operation()
to unmount a mountable file.FileExt::eject_mountable_with_operation()
to eject a mountable file.
Entity Tags # {gfile
-etag}
One notable feature of GFiles
are entity tags, or “etags” for
short. Entity tags are somewhat like a more abstract version of the
traditional mtime, and can be used to quickly determine if the file
has been modified from the version on the file system. See the
HTTP 1.1
specification
for HTTP Etag headers, which are a very similar concept.
Implements
Implementations§
source§impl File
impl File
pub const NONE: Option<&'static File> = None
sourcepub fn for_commandline_arg(arg: impl AsRef<OsStr>) -> File
pub fn for_commandline_arg(arg: impl AsRef<OsStr>) -> File
Creates a File
with the given argument from the command line.
The value of arg
can be either a URI, an absolute path or a
relative path resolved relative to the current working directory.
This operation never fails, but the returned object might not
support any I/O operation if arg
points to a malformed path.
Note that on Windows, this function expects its argument to be in
UTF-8 – not the system code page. This means that you
should not use this function with string from argv as it is passed
to main()
. g_win32_get_command_line()
will return a UTF-8 version of
the commandline. Application
also uses UTF-8 but
ApplicationCommandLineExt::create_file_for_arg()
may be more useful
for you there. It is also always possible to use this function with
GOptionContext
arguments of type glib::OptionArg::Filename
.
arg
a command line string
Returns
a new File
.
Free the returned object with g_object_unref()
.
sourcepub fn for_commandline_arg_and_cwd(
arg: impl AsRef<OsStr>,
cwd: impl AsRef<Path>
) -> File
pub fn for_commandline_arg_and_cwd( arg: impl AsRef<OsStr>, cwd: impl AsRef<Path> ) -> File
Creates a File
with the given argument from the command line.
This function is similar to for_commandline_arg()
except
that it allows for passing the current working directory as an
argument instead of using the current working directory of the
process.
This is useful if the commandline argument was given in a context other than the invocation of the current process.
See also ApplicationCommandLineExt::create_file_for_arg()
.
arg
a command line string
cwd
the current working directory of the commandline
Returns
a new File
sourcepub fn for_path(path: impl AsRef<Path>) -> File
pub fn for_path(path: impl AsRef<Path>) -> File
Constructs a File
for a given path. This operation never
fails, but the returned object might not support any I/O
operation if path
is malformed.
path
a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
Returns
a new File
for the given path
.
Free the returned object with g_object_unref()
.
sourcepub fn for_uri(uri: &str) -> File
pub fn for_uri(uri: &str) -> File
Constructs a File
for a given URI. This operation never
fails, but the returned object might not support any I/O
operation if uri
is malformed or if the uri type is
not supported.
uri
a UTF-8 string containing a URI
Returns
a new File
for the given uri
.
Free the returned object with g_object_unref()
.
sourcepub fn new_tmp(
tmpl: Option<impl AsRef<Path>>
) -> Result<(File, FileIOStream), Error>
pub fn new_tmp( tmpl: Option<impl AsRef<Path>> ) -> Result<(File, FileIOStream), Error>
Opens a file in the preferred directory for temporary files (as
returned by g_get_tmp_dir()
) and returns a File
and
FileIOStream
pointing to it.
tmpl
should be a string in the GLib file name encoding
containing a sequence of six ‘X’ characters, and containing no
directory components. If it is None
, a default template is used.
Unlike the other File
constructors, this will return None
if
a temporary file could not be created.
tmpl
Template for the file
name, as in g_file_open_tmp()
, or None
for a default template
Returns
a new File
.
Free the returned object with g_object_unref()
.
iostream
on return, a FileIOStream
for the created file
sourcepub fn for_parse_name(parse_name: &str) -> File
pub fn for_parse_name(parse_name: &str) -> File
Constructs a File
with the given parse_name
(i.e. something
given by FileExt::parse_name()
). This operation never fails,
but the returned object might not support any I/O operation if
the parse_name
cannot be parsed.
parse_name
a file name or path to be parsed
Returns
a new File
.
Trait Implementations§
source§impl Ord for File
impl Ord for File
source§impl<OT: ObjectType> PartialEq<OT> for File
impl<OT: ObjectType> PartialEq<OT> for File
source§impl<OT: ObjectType> PartialOrd<OT> for File
impl<OT: ObjectType> PartialOrd<OT> for File
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for File
impl StaticType for File
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for File
impl Send for File
impl Sync for File
Auto Trait Implementations§
Blanket Implementations§
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: CanDowncast<T>,
fn downcast<T>(self) -> Result<T, Self>where T: ObjectType, Self: CanDowncast<T>,
T
. Read moresource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast_ref<T>(&self) -> Option<&T>where T: ObjectType, Self: CanDowncast<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 downcast
and upcast
will do many checks at compile-time already. 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> 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<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 try_set_property<V>(
&self,
property_name: &str,
value: V
) -> Result<(), BoolError>where
V: ToValue,
fn try_set_property<V>( &self, property_name: &str, value: V ) -> Result<(), BoolError>where V: ToValue,
Self::set_property
but fails instead of panicking.source§fn set_property<V>(&self, property_name: &str, value: V)where
V: ToValue,
fn set_property<V>(&self, property_name: &str, value: V)where V: ToValue,
source§fn try_set_property_from_value(
&self,
property_name: &str,
value: &Value
) -> Result<(), BoolError>
fn try_set_property_from_value( &self, property_name: &str, value: &Value ) -> Result<(), BoolError>
Self::set_property
but fails instead of panicking.source§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
source§fn try_set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
fn try_set_properties( &self, property_values: &[(&str, &dyn ToValue)] ) -> Result<(), BoolError>
Self::set_properties
but fails instead of panicking.source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
source§fn try_set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
fn try_set_properties_from_value( &self, property_values: &[(&str, Value)] ) -> Result<(), BoolError>
Self::set_properties_from_value
but fails instead of panicking.source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
source§fn try_property<V>(&self, property_name: &str) -> Result<V, BoolError>where
V: for<'b> FromValue<'b> + 'static,
fn try_property<V>(&self, property_name: &str) -> Result<V, BoolError>where V: for<'b> FromValue<'b> + 'static,
Self::property
but fails instead of panicking.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 try_property_value(&self, property_name: &str) -> Result<Value, BoolError>
fn try_property_value(&self, property_name: &str) -> Result<Value, BoolError>
Self::property_value
but fails instead of panicking.source§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 try_connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError>where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn try_connect<F>( &self, signal_name: &str, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
Self::connect
but fails instead of panicking.source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn connect<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
signal_name
on this object. Read moresource§fn try_connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError>where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn try_connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
Self::connect_id
but fails instead of panicking.source§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
signal_id
on this object. Read moresource§fn try_connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError>where
F: Fn(&[Value]) -> Option<Value> + 'static,
fn try_connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + 'static,
Self::connect_local
but fails instead of panicking.source§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + 'static,
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,
signal_name
on this object. Read moresource§fn try_connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError>where
F: Fn(&[Value]) -> Option<Value> + 'static,
fn try_connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + 'static,
Self::connect_local_id
but fails instead of panicking.source§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + 'static,
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,
signal_id
on this object. Read moresource§unsafe fn try_connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError>where
F: Fn(&[Value]) -> Option<Value>,
unsafe fn try_connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value>,
Self::connect_unsafe
but fails instead of panicking.source§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,
signal_name
on this object. Read moresource§unsafe fn try_connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError>where
F: Fn(&[Value]) -> Option<Value>,
unsafe fn try_connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value>,
Self::connect_unsafe_id
but fails instead of panicking.source§fn try_connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure
) -> Result<SignalHandlerId, BoolError>
fn try_connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure ) -> Result<SignalHandlerId, BoolError>
Self::connect_closure
but fails instead of panicking.source§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 try_connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure
) -> Result<SignalHandlerId, BoolError>
fn try_connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure ) -> Result<SignalHandlerId, BoolError>
Self::connect_closure_id
but fails instead of panicking.source§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
Closure::invoke
.source§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,
signal_id
on this object. Read moresource§fn try_emit<R>(
&self,
signal_id: SignalId,
args: &[&dyn ToValue]
) -> Result<R, BoolError>where
R: TryFromClosureReturnValue,
fn try_emit<R>( &self, signal_id: SignalId, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,
Self::emit
but fails instead of panicking.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 try_emit_with_values(
&self,
signal_id: SignalId,
args: &[Value]
) -> Result<Option<Value>, BoolError>
fn try_emit_with_values( &self, signal_id: SignalId, args: &[Value] ) -> Result<Option<Value>, BoolError>
Self::emit_with_values
but fails instead of panicking.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 try_emit_by_name<R>(
&self,
signal_name: &str,
args: &[&dyn ToValue]
) -> Result<R, BoolError>where
R: TryFromClosureReturnValue,
fn try_emit_by_name<R>( &self, signal_name: &str, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,
Self::emit_by_name
but fails instead of panicking.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 try_emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value]
) -> Result<Option<Value>, BoolError>
fn try_emit_by_name_with_values( &self, signal_name: &str, args: &[Value] ) -> Result<Option<Value>, BoolError>
Self::emit_by_name_with_values
but fails instead of panicking.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 try_emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue]
) -> Result<R, BoolError>where
R: TryFromClosureReturnValue,
fn try_emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,
Self::emit_by_name_with_details
but fails instead of panicking.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 try_emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value]
) -> Result<Option<Value>, BoolError>
fn try_emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value] ) -> Result<Option<Value>, BoolError>
Self::emit_by_name_with_details_and_values
but fails instead of panicking.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 try_emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue]
) -> Result<R, BoolError>where
R: TryFromClosureReturnValue,
fn try_emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,
Self::emit_with_details
but fails instead of panicking.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 try_emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value]
) -> Result<Option<Value>, BoolError>
fn try_emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value] ) -> Result<Option<Value>, BoolError>
Self::emit_with_details_and_values
but fails instead of panicking.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) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec) + Send + Sync + 'static,
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + Send + Sync + 'static,
notify
signal of the object. Read moresource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec) + 'static,
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + 'static,
notify
signal of the object. Read moresource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec),
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F ) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec),
notify
signal of the object. Read moresource§fn notify(&self, property_name: &str)
fn notify(&self, property_name: &str)
source§fn notify_by_pspec(&self, pspec: &ParamSpec)
fn notify_by_pspec(&self, pspec: &ParamSpec)
source§fn bind_property<O, 'a>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str
) -> BindingBuilder<'a>where
O: ObjectType,
fn bind_property<O, 'a>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str ) -> BindingBuilder<'a>where O: ObjectType,
source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere T: StaticType,
source§fn ensure_type()
fn ensure_type()
source§impl<T> ToClosureReturnValue for Twhere
T: ToValue,
impl<T> ToClosureReturnValue for Twhere T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
source§impl<T> ToSendValue for Twhere
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for Twhere T: Send + ToValue + ?Sized,
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.