gio::prelude

Trait FileInputStreamExt

Source
pub trait FileInputStreamExt:
    IsA<FileInputStream>
    + Sealed
    + 'static {
    // Provided methods
    fn query_info(
        &self,
        attributes: &str,
        cancellable: Option<&impl IsA<Cancellable>>,
    ) -> Result<FileInfo, Error> { ... }
    fn query_info_async<P: FnOnce(Result<FileInfo, Error>) + 'static>(
        &self,
        attributes: &str,
        io_priority: Priority,
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P,
    ) { ... }
    fn query_info_future(
        &self,
        attributes: &str,
        io_priority: Priority,
    ) -> Pin<Box_<dyn Future<Output = Result<FileInfo, Error>> + 'static>> { ... }
}
Expand description

Trait containing all FileInputStream methods.

§Implementors

FileInputStream

Provided Methods§

Source

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

Queries a file input stream the given @attributes. This function blocks while querying the stream. For the asynchronous (non-blocking) version of this function, see g_file_input_stream_query_info_async(). While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with IOErrorEnum::Pending.

§attributes

a file attribute query string.

§cancellable

optional #GCancellable object, None to ignore.

§Returns

a #GFileInfo, or None on error.

Source

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

Queries the stream information asynchronously. When the operation is finished @callback will be called. You can then call g_file_input_stream_query_info_finish() to get the result of the operation.

For the synchronous version of this function, see g_file_input_stream_query_info().

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 set

§attributes

a file attribute query string.

§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 query_info_future( &self, attributes: &str, io_priority: Priority, ) -> Pin<Box_<dyn Future<Output = Result<FileInfo, Error>> + 'static>>

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.

Implementors§