Skip to main content

FileEnumeratorExt

Trait FileEnumeratorExt 

Source
pub trait FileEnumeratorExt: IsA<FileEnumerator> + 'static {
    // Provided methods
    fn close_async<P: FnOnce(Result<(), Error>) + 'static>(
        &self,
        io_priority: Priority,
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P,
    ) { ... }
    fn close_future(
        &self,
        io_priority: Priority,
    ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
    fn child(&self, info: &FileInfo) -> File { ... }
    fn container(&self) -> File { ... }
    fn has_pending(&self) -> bool { ... }
    fn is_closed(&self) -> bool { ... }
    fn next_file(
        &self,
        cancellable: Option<&impl IsA<Cancellable>>,
    ) -> Result<Option<FileInfo>, Error> { ... }
    fn next_files_async<P: FnOnce(Result<Vec<FileInfo>, Error>) + 'static>(
        &self,
        num_files: i32,
        io_priority: Priority,
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P,
    ) { ... }
    fn next_files_future(
        &self,
        num_files: i32,
        io_priority: Priority,
    ) -> Pin<Box_<dyn Future<Output = Result<Vec<FileInfo>, Error>> + 'static>> { ... }
    fn set_pending(&self, pending: bool) { ... }
}
Expand description

Trait containing all FileEnumerator methods.

§Implementors

FileEnumerator

Provided Methods§

Source

fn close_async<P: FnOnce(Result<(), Error>) + 'static>( &self, io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronously closes the file enumerator.

If @cancellable is not None, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IOErrorEnum::Cancelled will be returned in g_file_enumerator_close_finish().

§io_priority

the I/O priority of the request

§cancellable

optional #GCancellable object, None to ignore.

§callback

a #GAsyncReadyCallback to call when the request is satisfied

Source

fn close_future( &self, io_priority: Priority, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

Source

fn child(&self, info: &FileInfo) -> File

gchar *name = g_file_info_get_name (info); GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr), name); ]|

§info

a #GFileInfo gotten from g_file_enumerator_next_file() or the async equivalents.

§Returns

a #GFile for the #GFileInfo passed it.

Source

fn container(&self) -> File

Get the #GFile container which is being enumerated.

§Returns

the #GFile which is being enumerated.

Source

fn has_pending(&self) -> bool

Checks if the file enumerator has pending operations.

§Returns

true if the @self has pending operations.

Source

fn is_closed(&self) -> bool

Checks if the file enumerator has been closed.

§Returns

true if the @self is closed.

Source

fn next_file( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Option<FileInfo>, Error>

Returns information for the next file in the enumerated object. Will block until the information is available. The #GFileInfo returned from this function will contain attributes that match the attribute string that was passed when the #GFileEnumerator was created.

See the documentation of #GFileEnumerator for information about the order of returned files.

On error, returns None and sets @error to the error. If the enumerator is at the end, None will be returned and @error will be unset.

§cancellable

optional #GCancellable object, None to ignore.

§Returns

A #GFileInfo or None on error or end of enumerator. Free the returned object with g_object_unref() when no longer needed.

Source

fn next_files_async<P: FnOnce(Result<Vec<FileInfo>, Error>) + 'static>( &self, num_files: i32, io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

message); ]|

During an async request no other sync and async calls are allowed, and will result in IOErrorEnum::Pending errors.

Any outstanding I/O request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is G_PRIORITY_DEFAULT.

§num_files

the number of file info objects to request

§io_priority

the I/O priority of the request

§cancellable

optional #GCancellable object, None to ignore.

§callback

a #GAsyncReadyCallback to call when the request is satisfied

Source

fn next_files_future( &self, num_files: i32, io_priority: Priority, ) -> Pin<Box_<dyn Future<Output = Result<Vec<FileInfo>, Error>> + 'static>>

Source

fn set_pending(&self, pending: bool)

Sets the file enumerator as having pending operations.

§pending

a boolean value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§