pub struct MountEntry { /* private fields */ }v2_84 only.Expand description
Defines a Unix mount entry (e.g. /media/cdrom).
This corresponds roughly to a mtab entry.
GLib type: Boxed type with copy-on-clone semantics.
Implementations§
Source§impl MountEntry
impl MountEntry
Sourcepub fn as_ptr(&self) -> *mut GUnixMountEntry
pub fn as_ptr(&self) -> *mut GUnixMountEntry
Return the inner pointer to the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut GUnixMountEntry) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GUnixMountEntry) -> &Self
Borrows the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow_mut(
ptr: &mut *mut GUnixMountEntry,
) -> &mut Self
pub unsafe fn from_glib_ptr_borrow_mut( ptr: &mut *mut GUnixMountEntry, ) -> &mut Self
Borrows the underlying C value mutably.
Source§impl MountEntry
impl MountEntry
Sourcepub fn device_path(&self) -> PathBuf
pub fn device_path(&self) -> PathBuf
Sourcepub fn mount_path(&self) -> PathBuf
pub fn mount_path(&self) -> PathBuf
Sourcepub fn options(&self) -> Option<GString>
pub fn options(&self) -> Option<GString>
Gets a comma separated list of mount options for the Unix mount.
For example: rw,relatime,seclabel,data=ordered.
This is similar to MountPoint::options(), but it takes
a MountEntry as an argument.
§Returns
a string containing the options, or NULL if not
available.
Sourcepub fn root_path(&self) -> Option<GString>
pub fn root_path(&self) -> Option<GString>
Gets the root of the mount within the filesystem. This is useful e.g. for mounts created by bind operation, or btrfs subvolumes.
For example, the root path is equal to / for a mount created by
mount /dev/sda1 /mnt/foo and /bar for
mount --bind /mnt/foo/bar /mnt/bar.
§Returns
a string containing the root, or NULL if not supported
Sourcepub fn guess_can_eject(&self) -> bool
pub fn guess_can_eject(&self) -> bool
Guesses whether a Unix mount entry can be ejected.
§Returns
true if @self is deemed to be ejectable; false otherwise
Sourcepub fn guess_icon(&self) -> Icon
pub fn guess_icon(&self) -> Icon
Sourcepub fn guess_name(&self) -> GString
pub fn guess_name(&self) -> GString
Guesses the name of a Unix mount entry.
The result is a translated string.
§Returns
a newly allocated translated string
Sourcepub fn guess_should_display(&self) -> bool
pub fn guess_should_display(&self) -> bool
Guesses whether a Unix mount entry should be displayed in the UI.
§Returns
true if @self is deemed to be displayable; false otherwise
Sourcepub fn guess_symbolic_icon(&self) -> Icon
pub fn guess_symbolic_icon(&self) -> Icon
Sourcepub fn is_readonly(&self) -> bool
pub fn is_readonly(&self) -> bool
Sourcepub fn is_system_internal(&self) -> bool
pub fn is_system_internal(&self) -> bool
Checks if a Unix mount is a system mount.
This is the Boolean OR of
[is_system_fs_type()][crate::is_system_fs_type()], [is_system_device_path()][crate::is_system_device_path()] and
[is_mount_path_system_internal()][crate::is_mount_path_system_internal()] on @self’s properties.
The definition of what a ‘system’ mount entry is may change over time as new file system types and device paths are ignored.
§Returns
true if the Unix mount is for a system path; false otherwise
Sourcepub fn for_mount_path(mount_path: impl AsRef<Path>) -> (Option<MountEntry>, u64)
pub fn for_mount_path(mount_path: impl AsRef<Path>) -> (Option<MountEntry>, u64)
Gets a MountEntry for a given mount path.
If @time_read is set, it will be filled with a Unix timestamp for checking
if the mounts have changed since with
[mount_entries_changed_since()][crate::mount_entries_changed_since()].
If more mounts have the same mount path, the last matching mount is returned.
This will return NULL if there is no mount point at @mount_path.
§mount_path
path for a possible Unix mount
§Returns
§time_read
return location for a timestamp
Sourcepub fn for_file_path(file_path: impl AsRef<Path>) -> (Option<MountEntry>, u64)
pub fn for_file_path(file_path: impl AsRef<Path>) -> (Option<MountEntry>, u64)
Gets a MountEntry for a given file path.
If @time_read is set, it will be filled with a Unix timestamp for checking
if the mounts have changed since with
[mount_entries_changed_since()][crate::mount_entries_changed_since()].
If more mounts have the same mount path, the last matching mount is returned.
This will return NULL if looking up the mount entry fails, if
@file_path doesn’t exist or there is an I/O error.
§file_path
file path on some Unix mount
§Returns
§time_read
return location for a timestamp
Source§impl MountEntry
impl MountEntry
pub fn mounts() -> (Vec<MountEntry>, u64)
pub fn mounts_from_file(table_path: impl AsRef<Path>) -> (Vec<MountEntry>, u64)
pub fn is_changed_since(time: u64) -> bool
Trait Implementations§
Source§impl Clone for MountEntry
impl Clone for MountEntry
Source§impl Debug for MountEntry
impl Debug for MountEntry
Source§impl From<MountEntry> for Value
impl From<MountEntry> for Value
Source§fn from(o: MountEntry) -> Self
fn from(o: MountEntry) -> Self
Source§impl HasParamSpec for MountEntry
impl HasParamSpec for MountEntry
type ParamSpec = ParamSpecBoxed
Source§type SetValue = MountEntry
type SetValue = MountEntry
type BuilderFn = fn(&str) -> ParamSpecBoxedBuilder<'_, MountEntry>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Ord for MountEntry
impl Ord for MountEntry
Source§impl PartialEq for MountEntry
impl PartialEq for MountEntry
Source§impl PartialOrd for MountEntry
impl PartialOrd for MountEntry
Source§impl StaticType for MountEntry
impl StaticType for MountEntry
Source§fn static_type() -> Type
fn static_type() -> Type
Self.impl Eq for MountEntry
impl Send for MountEntry
impl Sync for MountEntry
Auto Trait Implementations§
impl Freeze for MountEntry
impl RefUnwindSafe for MountEntry
impl Unpin for MountEntry
impl UnwindSafe for MountEntry
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
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<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
Source§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere
T: HasParamSpec,
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> ToSendValue for T
impl<T> ToSendValue for T
Source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue clone of self.