Trait gio::prelude::FileExtManual [−][src]
pub trait FileExtManual: Sized { fn replace_contents_async<B: AsRef<[u8]> + Send + 'static, R: FnOnce(Result<(B, GString), (B, Error)>) + Send + 'static, C: IsA<Cancellable>>(
&self,
contents: B,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags,
cancellable: Option<&C>,
callback: R
); fn replace_contents_async_future<B: AsRef<[u8]> + Send + 'static>(
&self,
contents: B,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags
) -> Pin<Box<dyn Future<Output = Result<(B, GString), (B, Error)>> + 'static>>; fn enumerate_children_async<P: IsA<Cancellable>, Q: FnOnce(Result<FileEnumerator, Error>) + Send + 'static>(
&self,
attributes: &'static str,
flags: FileQueryInfoFlags,
io_priority: Priority,
cancellable: Option<&P>,
callback: Q
); fn enumerate_children_async_future(
&self,
attributes: &'static str,
flags: FileQueryInfoFlags,
io_priority: Priority
) -> Pin<Box<dyn Future<Output = Result<FileEnumerator, Error>> + 'static>>; }
Required methods
Starts an asynchronous replacement of self with the given
contents of length bytes. etag will replace the document’s
current entity tag.
When this operation has completed, callback will be called with
user_user data, and the operation can be finalized with
g_file_replace_contents_finish().
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.
If make_backup is true, this function will attempt to
make a backup of self.
Note that no copy of contents will be made, so it must stay valid
until callback is called. See g_file_replace_contents_bytes_async()
for a glib::Bytes version that will automatically hold a reference to the
contents (without copying) for the duration of the call.
contents
string of contents to replace the file with
etag
a new [entity tag][gfile-etag] for the self, or None
make_backup
true if a backup should be created
flags
a set of FileCreateFlags
cancellable
optional Cancellable object, None to ignore
callback
a GAsyncReadyCallback to call when the request is satisfied
fn replace_contents_async_future<B: AsRef<[u8]> + Send + 'static>(
&self,
contents: B,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags
) -> Pin<Box<dyn Future<Output = Result<(B, GString), (B, Error)>> + 'static>>fn enumerate_children_async<P: IsA<Cancellable>, Q: FnOnce(Result<FileEnumerator, Error>) + Send + 'static>(
&self,
attributes: &'static str,
flags: FileQueryInfoFlags,
io_priority: Priority,
cancellable: Option<&P>,
callback: Q
)fn enumerate_children_async_future(
&self,
attributes: &'static str,
flags: FileQueryInfoFlags,
io_priority: Priority
) -> Pin<Box<dyn Future<Output = Result<FileEnumerator, Error>> + 'static>>