pub trait MountExt:
IsA<Mount>
+ Sealed
+ 'static {
Show 26 methods
// Provided methods
fn can_eject(&self) -> bool { ... }
fn can_unmount(&self) -> bool { ... }
fn eject_with_operation<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn eject_with_operation_future(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>,
) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
fn default_location(&self) -> File { ... }
fn drive(&self) -> Option<Drive> { ... }
fn icon(&self) -> Icon { ... }
fn name(&self) -> GString { ... }
fn root(&self) -> File { ... }
fn sort_key(&self) -> Option<GString> { ... }
fn symbolic_icon(&self) -> Icon { ... }
fn uuid(&self) -> Option<GString> { ... }
fn volume(&self) -> Option<Volume> { ... }
fn guess_content_type<P: FnOnce(Result<Vec<GString>, Error>) + 'static>(
&self,
force_rescan: bool,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn guess_content_type_future(
&self,
force_rescan: bool,
) -> Pin<Box_<dyn Future<Output = Result<Vec<GString>, Error>> + 'static>> { ... }
fn guess_content_type_sync(
&self,
force_rescan: bool,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Vec<GString>, Error> { ... }
fn is_shadowed(&self) -> bool { ... }
fn remount<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountMountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn remount_future(
&self,
flags: MountMountFlags,
mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>,
) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
fn shadow(&self) { ... }
fn unmount_with_operation<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn unmount_with_operation_future(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>,
) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
fn unshadow(&self) { ... }
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn connect_pre_unmount<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_unmounted<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
}
Provided Methods§
Sourcefn can_unmount(&self) -> bool
fn can_unmount(&self) -> bool
Sourcefn eject_with_operation<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn eject_with_operation<P: FnOnce(Result<(), Error>) + 'static>( &self, flags: MountUnmountFlags, mount_operation: Option<&impl IsA<MountOperation>>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Ejects a mount. This is an asynchronous operation, and is finished by calling g_mount_eject_with_operation_finish() with the @self and #GAsyncResult data returned in the @callback.
§flags
flags affecting the unmount if required for eject
§mount_operation
a #GMountOperation or None
to avoid
user interaction.
§cancellable
optional #GCancellable object, None
to ignore.
§callback
a #GAsyncReadyCallback, or None
.
fn eject_with_operation_future( &self, flags: MountUnmountFlags, mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn default_location(&self) -> File
fn default_location(&self) -> File
Gets the default location of @self. The default location of the given @self is a path that reflects the main entry point for the user (e.g. the home directory, or the root of the volume).
§Returns
a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
Sourcefn icon(&self) -> Icon
fn icon(&self) -> Icon
Gets the icon for @self.
§Returns
a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
Sourcefn name(&self) -> GString
fn name(&self) -> GString
Gets the name of @self.
§Returns
the name for the given @self. The returned string should be freed with g_free() when no longer needed.
Sourcefn root(&self) -> File
fn root(&self) -> File
Gets the root directory on @self.
§Returns
a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
Sourcefn symbolic_icon(&self) -> Icon
fn symbolic_icon(&self) -> Icon
Gets the symbolic icon for @self.
§Returns
a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
Sourcefn uuid(&self) -> Option<GString>
fn uuid(&self) -> Option<GString>
Gets the UUID for the @self. The reference is typically based on
the file system UUID for the mount in question and should be
considered an opaque string. Returns None
if there is no UUID
available.
§Returns
the UUID for @self or None
if no UUID
can be computed.
The returned string should be freed with g_free()
when no longer needed.
Sourcefn guess_content_type<P: FnOnce(Result<Vec<GString>, Error>) + 'static>(
&self,
force_rescan: bool,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn guess_content_type<P: FnOnce(Result<Vec<GString>, Error>) + 'static>( &self, force_rescan: bool, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Tries to guess the type of content stored on @self. Returns one or more textual identifiers of well-known content types (typically prefixed with “x-content/”), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is an asynchronous operation (see g_mount_guess_content_type_sync() for the synchronous version), and is finished by calling g_mount_guess_content_type_finish() with the @self and #GAsyncResult data returned in the @callback.
§force_rescan
Whether to force a rescan of the content. Otherwise a cached result will be used if available
§cancellable
optional #GCancellable object, None
to ignore
§callback
a #GAsyncReadyCallback
fn guess_content_type_future( &self, force_rescan: bool, ) -> Pin<Box_<dyn Future<Output = Result<Vec<GString>, Error>> + 'static>>
Sourcefn guess_content_type_sync(
&self,
force_rescan: bool,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Vec<GString>, Error>
fn guess_content_type_sync( &self, force_rescan: bool, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Vec<GString>, Error>
Tries to guess the type of content stored on @self. Returns one or more textual identifiers of well-known content types (typically prefixed with “x-content/”), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is a synchronous operation and as such may block doing IO; see g_mount_guess_content_type() for the asynchronous version.
§force_rescan
Whether to force a rescan of the content. Otherwise a cached result will be used if available
§cancellable
optional #GCancellable object, None
to ignore
§Returns
a None
-terminated array of content types or None
on error.
Caller should free this array with g_strfreev() when done with it.
Sourcefn is_shadowed(&self) -> bool
fn is_shadowed(&self) -> bool
Determines if @self is shadowed. Applications or libraries should avoid displaying @self in the user interface if it is shadowed.
A mount is said to be shadowed if there exists one or more user visible objects (currently #GMount objects) with a root that is inside the root of @self.
One application of shadow mounts is when exposing a single file
system that is used to address several logical volumes. In this
situation, a #GVolumeMonitor implementation would create two
#GVolume objects (for example, one for the camera functionality of
the device and one for a SD card reader on the device) with
activation URIs gphoto2://[usb:001,002]/store1/
and gphoto2://[usb:001,002]/store2/
. When the
underlying mount (with root
gphoto2://[usb:001,002]/
) is mounted, said
#GVolumeMonitor implementation would create two #GMount objects
(each with their root matching the corresponding volume activation
root) that would shadow the original mount.
The proxy monitor in GVfs 2.26 and later, automatically creates and manage shadow mounts (and shadows the underlying mount) if the activation root on a #GVolume is set.
§Returns
true
if @self is shadowed.
Sourcefn remount<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountMountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn remount<P: FnOnce(Result<(), Error>) + 'static>( &self, flags: MountMountFlags, mount_operation: Option<&impl IsA<MountOperation>>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Remounts a mount. This is an asynchronous operation, and is finished by calling g_mount_remount_finish() with the @self and #GAsyncResults data returned in the @callback.
Remounting is useful when some setting affecting the operation of the volume has been changed, as these may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting not all backends might need to actually be unmounted.
§flags
flags affecting the operation
§mount_operation
a #GMountOperation or None
to avoid
user interaction.
§cancellable
optional #GCancellable object, None
to ignore.
§callback
a #GAsyncReadyCallback, or None
.
fn remount_future( &self, flags: MountMountFlags, mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn shadow(&self)
fn shadow(&self)
Increments the shadow count on @self. Usually used by #GVolumeMonitor implementations when creating a shadow mount for @self, see g_mount_is_shadowed() for more information. The caller will need to emit the #GMount::changed signal on @self manually.
Sourcefn unmount_with_operation<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn unmount_with_operation<P: FnOnce(Result<(), Error>) + 'static>( &self, flags: MountUnmountFlags, mount_operation: Option<&impl IsA<MountOperation>>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Unmounts a mount. This is an asynchronous operation, and is finished by calling g_mount_unmount_with_operation_finish() with the @self and #GAsyncResult data returned in the @callback.
§flags
flags affecting the operation
§mount_operation
a #GMountOperation or None
to avoid
user interaction.
§cancellable
optional #GCancellable object, None
to ignore.
§callback
a #GAsyncReadyCallback, or None
.
fn unmount_with_operation_future( &self, flags: MountUnmountFlags, mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn unshadow(&self)
fn unshadow(&self)
Decrements the shadow count on @self. Usually used by #GVolumeMonitor implementations when destroying a shadow mount for @self, see g_mount_is_shadowed() for more information. The caller will need to emit the #GMount::changed signal on @self manually.
Sourcefn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the mount has been changed.
Sourcefn connect_pre_unmount<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_pre_unmount<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
This signal may be emitted when the #GMount is about to be unmounted.
This signal depends on the backend and is only emitted if GIO was used to unmount.
Sourcefn connect_unmounted<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_unmounted<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
This signal is emitted when the #GMount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.