pub trait OutputStreamImpl:
Send
+ ObjectImpl
+ ObjectSubclass{
// Provided methods
fn write(
&self,
buffer: &[u8],
cancellable: Option<&Cancellable>,
) -> Result<usize, Error> { ... }
fn close(&self, cancellable: Option<&Cancellable>) -> Result<(), Error> { ... }
fn flush(&self, cancellable: Option<&Cancellable>) -> Result<(), Error> { ... }
fn splice(
&self,
input_stream: &InputStream,
flags: OutputStreamSpliceFlags,
cancellable: Option<&Cancellable>,
) -> Result<usize, Error> { ... }
}
Provided Methods§
fn write( &self, buffer: &[u8], cancellable: Option<&Cancellable>, ) -> Result<usize, Error>
fn close(&self, cancellable: Option<&Cancellable>) -> Result<(), Error>
Sourcefn flush(&self, cancellable: Option<&Cancellable>) -> Result<(), Error>
fn flush(&self, cancellable: Option<&Cancellable>) -> Result<(), Error>
Forces a write of all user-space buffered data for the given @self. Will block during the operation. Closing the stream will implicitly cause a flush.
This function is optional for inherited classes.
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.
§cancellable
optional cancellable object
§Returns
Sourcefn splice(
&self,
input_stream: &InputStream,
flags: OutputStreamSpliceFlags,
cancellable: Option<&Cancellable>,
) -> Result<usize, Error>
fn splice( &self, input_stream: &InputStream, flags: OutputStreamSpliceFlags, cancellable: Option<&Cancellable>, ) -> Result<usize, Error>
Splices an input stream into an output stream.
§source
a #GInputStream.
§flags
a set of #GOutputStreamSpliceFlags.
§cancellable
optional #GCancellable object, None
to ignore.
§Returns
a #gssize containing the size of the data spliced, or
-1 if an error occurred. Note that if the number of bytes
spliced is greater than G_MAXSSIZE
, then that will be
returned, and there is no way to determine the actual number
of bytes spliced.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.