Skip to main content

RecentInfo

Struct RecentInfo 

Source
pub struct RecentInfo { /* private fields */ }
Expand description

RecentInfo-struct contains private data only, and should be accessed using the provided API.

RecentInfo constains all the meta-data associated with an entry in the recently used files list.

GLib type: Shared boxed type with reference counted clone semantics.

Implementations§

Source§

impl RecentInfo

Source

pub fn as_ptr(&self) -> *mut GtkRecentInfo

Return the inner pointer to the underlying C value.

Source

pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GtkRecentInfo) -> &Self

Borrows the underlying C value.

Source§

impl RecentInfo

Source

pub fn create_app_info( &self, app_name: Option<&str>, ) -> Result<Option<AppInfo>, Error>

Creates a gio::AppInfo for the specified RecentInfo

§app_name

the name of the application that should be mapped to a gio::AppInfo; if None is used then the default application for the MIME type is used

§Returns

the newly created gio::AppInfo, or None. In case of error, error will be set either with a GTK_RECENT_MANAGER_ERROR or a G_IO_ERROR

Source

pub fn exists(&self) -> bool

Checks whether the resource pointed by self still exists. At the moment this check is done only on resources pointing to local files.

§Returns

true if the resource exists

Source

pub fn added(&self) -> time_t

Gets the timestamp (seconds from system’s Epoch) when the resource was added to the recently used resources list.

§Returns

the number of seconds elapsed from system’s Epoch when the resource was added to the list, or -1 on failure.

Source

pub fn age(&self) -> i32

Gets the number of days elapsed since the last update of the resource pointed by self.

§Returns

a positive integer containing the number of days elapsed since the time this resource was last modified

Source

pub fn application_info(&self, app_name: &str) -> Option<(GString, u32, time_t)>

Gets the data regarding the application that has registered the resource pointed by self.

If the command line contains any escape characters defined inside the storage specification, they will be expanded.

§app_name

the name of the application that has registered this item

§Returns

true if an application with app_name has registered this resource inside the recently used list, or false otherwise. The app_exec string is owned by the RecentInfo and should not be modified or freed

§app_exec

return location for the string containing the command line

§count

return location for the number of times this item was registered

§time_

return location for the timestamp this item was last registered for this application

Source

pub fn applications(&self) -> Vec<GString>

Retrieves the list of applications that have registered this resource.

§Returns

a newly allocated None-terminated array of strings. Use g_strfreev() to free it.

Source

pub fn description(&self) -> Option<GString>

Gets the (short) description of the resource.

§Returns

the description of the resource. The returned string is owned by the recent manager, and should not be freed.

Source

pub fn display_name(&self) -> Option<GString>

Gets the name of the resource. If none has been defined, the basename of the resource is obtained.

§Returns

the display name of the resource. The returned string is owned by the recent manager, and should not be freed.

Source

pub fn gicon(&self) -> Option<Icon>

Retrieves the icon associated to the resource MIME type.

§Returns

a gio::Icon containing the icon, or None. Use g_object_unref() when finished using the icon

Source

pub fn groups(&self) -> Vec<GString>

Returns all groups registered for the recently used item self. The array of returned group names will be None terminated, so length might optionally be None.

§Returns

a newly allocated None terminated array of strings. Use g_strfreev() to free it.

Source

pub fn icon(&self, size: i32) -> Option<Pixbuf>

Retrieves the icon of size size associated to the resource MIME type.

§size

the size of the icon in pixels

§Returns

a gdk_pixbuf::Pixbuf containing the icon, or None. Use g_object_unref() when finished using the icon.

Source

pub fn mime_type(&self) -> Option<GString>

Gets the MIME type of the resource.

§Returns

the MIME type of the resource. The returned string is owned by the recent manager, and should not be freed.

Source

pub fn modified(&self) -> time_t

Gets the timestamp (seconds from system’s Epoch) when the meta-data for the resource was last modified.

§Returns

the number of seconds elapsed from system’s Epoch when the resource was last modified, or -1 on failure.

Source

pub fn is_private_hint(&self) -> bool

Gets the value of the “private” flag. Resources in the recently used list that have this flag set to true should only be displayed by the applications that have registered them.

§Returns

true if the private flag was found, false otherwise

Source

pub fn short_name(&self) -> Option<GString>

Computes a valid UTF-8 string that can be used as the name of the item in a menu or list. For example, calling this function on an item that refers to “file:///foo/bar.txt” will yield “bar.txt”.

§Returns

A newly-allocated string in UTF-8 encoding free it with g_free()

Source

pub fn uri(&self) -> Option<GString>

Gets the URI of the resource.

§Returns

the URI of the resource. The returned string is owned by the recent manager, and should not be freed.

Source

pub fn uri_display(&self) -> Option<GString>

Gets a displayable version of the resource’s URI. If the resource is local, it returns a local path; if the resource is not local, it returns the UTF-8 encoded content of uri().

§Returns

a newly allocated UTF-8 string containing the resource’s URI or None. Use g_free() when done using it.

Source

pub fn visited(&self) -> time_t

Gets the timestamp (seconds from system’s Epoch) when the meta-data for the resource was last visited.

§Returns

the number of seconds elapsed from system’s Epoch when the resource was last visited, or -1 on failure.

Source

pub fn has_application(&self, app_name: &str) -> bool

Checks whether an application registered this resource using app_name.

§app_name

a string containing an application name

§Returns

true if an application with name app_name was found, false otherwise

Source

pub fn has_group(&self, group_name: &str) -> bool

Checks whether group_name appears inside the groups registered for the recently used item self.

§group_name

name of a group

§Returns

true if the group was found

Source

pub fn is_local(&self) -> bool

Checks whether the resource is local or not by looking at the scheme of its URI.

§Returns

true if the resource is local

Source

pub fn last_application(&self) -> Option<GString>

Gets the name of the last application that have registered the recently used resource represented by self.

§Returns

an application name. Use g_free() to free it.

Source

pub fn match_(&self, info_b: &RecentInfo) -> bool

Checks whether two RecentInfo-struct point to the same resource.

§info_b

a RecentInfo

§Returns

true if both RecentInfo-struct point to the same resource, false otherwise

Trait Implementations§

Source§

impl Clone for RecentInfo

Source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the reference. Dropping the reference will decrement it again.

1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RecentInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RecentInfo

Source§

impl From<RecentInfo> for Value

Source§

fn from(s: RecentInfo) -> Self

Converts to this type from the input type.
Source§

impl HasParamSpec for RecentInfo

Source§

type ParamSpec = ParamSpecBoxed

Source§

type SetValue = RecentInfo

Preferred value to be used as setter for the associated ParamSpec.
Source§

type BuilderFn = fn(&str) -> ParamSpecBoxedBuilder<'_, RecentInfo>

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl Hash for RecentInfo

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for RecentInfo

Source§

fn cmp(&self, other: &RecentInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for RecentInfo

Source§

fn eq(&self, other: &RecentInfo) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for RecentInfo

Source§

fn partial_cmp(&self, other: &RecentInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for RecentInfo

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl StructuralPartialEq for RecentInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

Source§

impl<T> Property for T
where T: HasParamSpec,

Source§

type Value = T

Source§

impl<T> PropertyGet for T
where T: HasParamSpec,

Source§

type Value = T

Source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TransparentType for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.