Trait gio::prelude::FileIOStreamExt

source ·
pub trait FileIOStreamExt: IsA<FileIOStream> + Sealed + 'static {
    // Provided methods
    fn etag(&self) -> Option<GString> { ... }
    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 FileIOStream methods.

§Implementors

FileIOStream

Provided Methods§

source

fn etag(&self) -> Option<GString>

Gets the entity tag for the file when it has been written. This must be called after the stream has been written and closed, as the etag can change while writing.

§Returns

the entity tag for the stream.

source

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

Queries a file io stream for the given @attributes. This function blocks while querying the stream. For the asynchronous version of this function, see g_file_io_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.

Can fail if the stream was already closed (with @error being set to IOErrorEnum::Closed), the stream has pending operations (with @error being set to IOErrorEnum::Pending), or if querying info is not supported for the stream’s interface (with @error being set to IOErrorEnum::NotSupported). I all cases of failure, None will be returned.

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, and None will be returned.

§attributes

a file attribute query string.

§cancellable

optional #GCancellable object, None to ignore.

§Returns

a #GFileInfo for the @self, 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, )

Asynchronously queries the @self for a #GFileInfo. When completed, @callback will be called with a #GAsyncResult which can be used to finish the operation with g_file_io_stream_query_info_finish().

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

§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>>

Object Safety§

This trait is not object safe.

Implementors§