pub trait DriveExt:
IsA<Drive>
+ Sealed
+ 'static {
Show 30 methods
// Provided methods
fn can_eject(&self) -> bool { ... }
fn can_poll_for_media(&self) -> bool { ... }
fn can_start(&self) -> bool { ... }
fn can_start_degraded(&self) -> bool { ... }
fn can_stop(&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 enumerate_identifiers(&self) -> Vec<GString> { ... }
fn icon(&self) -> Icon { ... }
fn identifier(&self, kind: &str) -> Option<GString> { ... }
fn name(&self) -> GString { ... }
fn sort_key(&self) -> Option<GString> { ... }
fn start_stop_type(&self) -> DriveStartStopType { ... }
fn symbolic_icon(&self) -> Icon { ... }
fn volumes(&self) -> Vec<Volume> { ... }
fn has_media(&self) -> bool { ... }
fn has_volumes(&self) -> bool { ... }
fn is_media_check_automatic(&self) -> bool { ... }
fn is_media_removable(&self) -> bool { ... }
fn is_removable(&self) -> bool { ... }
fn poll_for_media<P: FnOnce(Result<(), Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn poll_for_media_future(
&self,
) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
fn start<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: DriveStartFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn start_future(
&self,
flags: DriveStartFlags,
mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>,
) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
fn stop<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn stop_future(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>,
) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn connect_disconnected<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_eject_button<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_stop_button<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Provided Methods§
Sourcefn can_poll_for_media(&self) -> bool
fn can_poll_for_media(&self) -> bool
Sourcefn can_start_degraded(&self) -> bool
fn can_start_degraded(&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 drive. This is an asynchronous operation, and is finished by calling g_drive_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 enumerate_identifiers(&self) -> Vec<GString>
fn enumerate_identifiers(&self) -> Vec<GString>
Sourcefn icon(&self) -> Icon
fn icon(&self) -> Icon
Gets the icon for @self.
§Returns
#GIcon for the @self. Free the returned object with g_object_unref().
Sourcefn identifier(&self, kind: &str) -> Option<GString>
fn identifier(&self, kind: &str) -> Option<GString>
Gets the identifier of the given kind for @self. The only
identifier currently available is
DRIVE_IDENTIFIER_KIND_UNIX_DEVICE
.
§kind
the kind of identifier to return
§Returns
a newly allocated string containing the
requested identifier, or None
if the #GDrive
doesn’t have this kind of identifier.
Sourcefn name(&self) -> GString
fn name(&self) -> GString
Gets the name of @self.
§Returns
a string containing @self’s name. The returned string should be freed when no longer needed.
Sourcefn start_stop_type(&self) -> DriveStartStopType
fn start_stop_type(&self) -> DriveStartStopType
Gets a hint about how a drive can be started/stopped.
§Returns
A value from the #GDriveStartStopType enumeration.
Sourcefn symbolic_icon(&self) -> Icon
fn symbolic_icon(&self) -> Icon
Gets the icon for @self.
§Returns
symbolic #GIcon for the @self. Free the returned object with g_object_unref().
Sourcefn volumes(&self) -> Vec<Volume>
fn volumes(&self) -> Vec<Volume>
Get a list of mountable volumes for @self.
The returned list should be freed with g_list_free(), after its elements have been unreffed with g_object_unref().
§Returns
#GList containing any #GVolume objects on the given @self.
Sourcefn has_volumes(&self) -> bool
fn has_volumes(&self) -> bool
Sourcefn is_media_check_automatic(&self) -> bool
fn is_media_check_automatic(&self) -> bool
Sourcefn is_media_removable(&self) -> bool
fn is_media_removable(&self) -> bool
Sourcefn is_removable(&self) -> bool
fn is_removable(&self) -> bool
Sourcefn poll_for_media<P: FnOnce(Result<(), Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn poll_for_media<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Asynchronously polls @self to see if media has been inserted or removed.
When the operation is finished, @callback will be called. You can then call g_drive_poll_for_media_finish() to obtain the result of the operation.
§cancellable
optional #GCancellable object, None
to ignore.
§callback
a #GAsyncReadyCallback, or None
.
fn poll_for_media_future( &self, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn start<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: DriveStartFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn start<P: FnOnce(Result<(), Error>) + 'static>( &self, flags: DriveStartFlags, mount_operation: Option<&impl IsA<MountOperation>>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Asynchronously starts a drive.
When the operation is finished, @callback will be called. You can then call g_drive_start_finish() to obtain the result of the operation.
§flags
flags affecting the start operation.
§mount_operation
a #GMountOperation or None
to avoid
user interaction.
§cancellable
optional #GCancellable object, None
to ignore.
§callback
a #GAsyncReadyCallback, or None
.
fn start_future( &self, flags: DriveStartFlags, mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn stop<P: FnOnce(Result<(), Error>) + 'static>(
&self,
flags: MountUnmountFlags,
mount_operation: Option<&impl IsA<MountOperation>>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn stop<P: FnOnce(Result<(), Error>) + 'static>( &self, flags: MountUnmountFlags, mount_operation: Option<&impl IsA<MountOperation>>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Asynchronously stops a drive.
When the operation is finished, @callback will be called. You can then call g_drive_stop_finish() to obtain the result of the operation.
§flags
flags affecting the unmount if required for stopping.
§mount_operation
a #GMountOperation or None
to avoid
user interaction.
§cancellable
optional #GCancellable object, None
to ignore.
§callback
a #GAsyncReadyCallback, or None
.
fn stop_future( &self, flags: MountUnmountFlags, mount_operation: Option<&(impl IsA<MountOperation> + Clone + 'static)>, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
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 drive’s state has changed.
Sourcefn connect_disconnected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_disconnected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
This signal is emitted when the #GDrive have been disconnected. If the recipient is holding references to the object they should release them so the object can be finalized.
Emitted when the physical eject button (if any) of a drive has been pressed.
Emitted when the physical stop button (if any) of a drive has been pressed.
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.