pub trait ContentProviderExt: IsA<ContentProvider> + 'static {
// Provided methods
fn content_changed(&self) { ... }
fn formats(&self) -> ContentFormats { ... }
fn storable_formats(&self) -> ContentFormats { ... }
fn write_mime_type_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
mime_type: &str,
stream: &impl IsA<OutputStream>,
io_priority: Priority,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
) { ... }
fn write_mime_type_future(
&self,
mime_type: &str,
stream: &(impl IsA<OutputStream> + Clone + 'static),
io_priority: Priority,
) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... }
fn connect_content_changed<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_storable_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
Sourcefn content_changed(&self)
fn content_changed(&self)
Emits the ::content-changed signal.
Sourcefn formats(&self) -> ContentFormats
fn formats(&self) -> ContentFormats
Gets the formats that the provider can provide its current contents in.
§Returns
The formats of the provider
Sourcefn storable_formats(&self) -> ContentFormats
fn storable_formats(&self) -> ContentFormats
Sourcefn write_mime_type_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
mime_type: &str,
stream: &impl IsA<OutputStream>,
io_priority: Priority,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn write_mime_type_async<P: FnOnce(Result<(), Error>) + 'static>( &self, mime_type: &str, stream: &impl IsA<OutputStream>, io_priority: Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Asynchronously writes the contents of @self to @stream in the given @mime_type.
The given mime type does not need to be listed in the formats returned by
formats()
. However, if the given GType
is
not supported, G_IO_ERROR_NOT_SUPPORTED
will be reported.
The given @stream will not be closed.
§mime_type
the mime type to provide the data in
§stream
the GOutputStream
to write to
§io_priority
I/O priority of the request.
§cancellable
optional GCancellable
object, None
to ignore.
§callback
callback to call when the request is satisfied
fn write_mime_type_future( &self, mime_type: &str, stream: &(impl IsA<OutputStream> + Clone + 'static), io_priority: Priority, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn connect_content_changed<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_content_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Emitted whenever the content provided by this provider has changed.
fn connect_formats_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_storable_formats_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
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.