Trait gio::prelude::FileIOStreamExt[][src]

pub trait FileIOStreamExt: 'static {
    fn etag(&self) -> Option<GString>;
fn query_info<P: IsA<Cancellable>>(
        &self,
        attributes: &str,
        cancellable: Option<&P>
    ) -> Result<FileInfo, Error>;
fn query_info_async<P: IsA<Cancellable>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(
        &self,
        attributes: &str,
        io_priority: Priority,
        cancellable: Option<&P>,
        callback: Q
    );
fn query_info_async_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

Required methods

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.

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

Returns

a FileInfo for the self, or None on error.

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

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

attributes

a file attribute query string.

io_priority

the [I/O priority][gio-GIOScheduler] of the request

cancellable

optional Cancellable object, None to ignore.

callback

callback to call when the request is satisfied

Implementors