Trait gio::prelude::FileIOStreamExt
source · pub trait FileIOStreamExt: 'static {
// Required 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
Required Methods§
sourcefn etag(&self) -> Option<GString>
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.
sourcefn query_info(
&self,
attributes: &str,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<FileInfo, Error>
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 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
sourcefn 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_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 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