Trait gio::subclass::prelude::OutputStreamImpl

source ·
pub trait OutputStreamImpl: ObjectImpl + OutputStreamImplExt + Send {
    // 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§

source

fn write( &self, buffer: &[u8], cancellable: Option<&Cancellable>, ) -> Result<usize, Error>

source

fn close(&self, cancellable: Option<&Cancellable>) -> Result<(), Error>

source

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

true on success, false on error

source

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.

Object Safety§

This trait is not object safe.

Implementors§