[−][src]Trait gio::prelude::FileExtManual
Required methods
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
)
&self,
contents: B,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags,
cancellable: Option<&C>,
callback: R
)
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
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 content
will be made, so it must stay valid
until callback
is called. See 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
length
the length of contents
in bytes
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
user_data
the data to pass to callback function
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>>
&self,
contents: B,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags
) -> Pin<Box<dyn Future<Output = Result<(B, GString), (B, Error)>> + 'static>>
Implementors
impl<O: IsA<File>> FileExtManual for O
[src]
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
)
[src]
&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>>
[src]
&self,
contents: B,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags
) -> Pin<Box<dyn Future<Output = Result<(B, GString), (B, Error)>> + 'static>>