Trait libflatpak::prelude::TransactionExt

source ·
pub trait TransactionExt:
    IsA<Transaction>
    + Sealed
    + 'static {
Show 48 methods // Provided methods fn abort_webflow(&self, id: u32) { ... } fn add_default_dependency_sources(&self) { ... } fn add_dependency_source(&self, installation: &impl IsA<Installation>) { ... } fn add_install( &self, remote: &str, ref_: &str, subpaths: &[&str], ) -> Result<(), Error> { ... } fn add_install_bundle( &self, file: &impl IsA<File>, gpg_data: Option<&Bytes>, ) -> Result<(), Error> { ... } fn add_install_flatpakref( &self, flatpakref_data: &Bytes, ) -> Result<(), Error> { ... } fn add_sideload_repo(&self, path: &str) { ... } fn add_uninstall(&self, ref_: &str) -> Result<(), Error> { ... } fn add_update( &self, ref_: &str, subpaths: &[&str], commit: Option<&str>, ) -> Result<(), Error> { ... } fn complete_basic_auth( &self, id: u32, user: &str, password: &str, options: &Variant, ) { ... } fn is_auto_install_debug(&self) -> bool { ... } fn is_auto_install_sdk(&self) -> bool { ... } fn current_operation(&self) -> Option<TransactionOperation> { ... } fn is_include_unused_uninstall_ops(&self) -> bool { ... } fn installation(&self) -> Option<Installation> { ... } fn is_no_deploy(&self) -> bool { ... } fn is_no_interaction(&self) -> bool { ... } fn is_no_pull(&self) -> bool { ... } fn operation_for_ref( &self, remote: Option<&str>, ref_: &str, ) -> Result<TransactionOperation, Error> { ... } fn operations(&self) -> Vec<TransactionOperation> { ... } fn parent_window(&self) -> Option<GString> { ... } fn is_empty(&self) -> bool { ... } fn run( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error> { ... } fn set_auto_install_debug(&self, auto_install_debug: bool) { ... } fn set_auto_install_sdk(&self, auto_install_sdk: bool) { ... } fn set_default_arch(&self, arch: &str) { ... } fn set_disable_auto_pin(&self, disable_pin: bool) { ... } fn set_disable_dependencies(&self, disable_dependencies: bool) { ... } fn set_disable_prune(&self, disable_prune: bool) { ... } fn set_disable_related(&self, disable_related: bool) { ... } fn set_disable_static_deltas(&self, disable_static_deltas: bool) { ... } fn set_force_uninstall(&self, force_uninstall: bool) { ... } fn set_include_unused_uninstall_ops( &self, include_unused_uninstall_ops: bool, ) { ... } fn set_no_deploy(&self, no_deploy: bool) { ... } fn set_no_interaction(&self, no_interaction: bool) { ... } fn set_no_pull(&self, no_pull: bool) { ... } fn set_parent_window(&self, parent_window: &str) { ... } fn set_reinstall(&self, reinstall: bool) { ... } fn connect_add_new_remote<F: Fn(&Self, TransactionRemoteReason, &str, &str, &str) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_basic_auth_start<F: Fn(&Self, &str, &str, &Variant, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_end_of_lifed<F: Fn(&Self, &str, &str, &str) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_install_authenticator<F: Fn(&Self, &str, &str) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_new_operation<F: Fn(&Self, &TransactionOperation, &TransactionProgress) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_ready<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_ready_pre_auth<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_webflow_done<F: Fn(&Self, &Variant, i32) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_webflow_start<F: Fn(&Self, &str, &str, &Variant, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_no_interaction_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Transaction methods.

§Implementors

Transaction

Provided Methods§

source

fn abort_webflow(&self, id: u32)

Cancel an ongoing webflow authentication request. This can be call in the time between webflow-start returned true, and webflow-done is emitted. It will cancel the ongoing authentication operation.

This is useful for example if you’re showing an authenticaion window with a browser, but the user closed it before it was finished.

§id

The webflow id, as passed into the webflow-start signal

source

fn add_default_dependency_sources(&self)

Similar to add_dependency_source(), but adds all the default installations, which means all the defined system-wide (but not per-user) installations.

source

fn add_dependency_source(&self, installation: &impl IsA<Installation>)

Adds an extra installation as a source for application dependencies. This means that applications can be installed in this transaction relying on runtimes from this additional installation (whereas it would normally install required runtimes that are not installed in the installation the transaction works on).

Also see add_default_dependency_sources().

§installation

a Installation

source

fn add_install( &self, remote: &str, ref_: &str, subpaths: &[&str], ) -> Result<(), Error>

Adds installing the given ref to this transaction.

The remote can either be a configured remote of the installation, or a file:// uri pointing at a local repository to install from, in which case an origin remote is created.

§remote

the name of the remote

§ref_

the ref

§subpaths

subpaths to install, or the empty list or None to pull all subpaths

§Returns

true on success; false with error set on failure.

source

fn add_install_bundle( &self, file: &impl IsA<File>, gpg_data: Option<&Bytes>, ) -> Result<(), Error>

Adds installing the given bundle to this transaction.

§file

a gio::File that is an flatpak bundle

§gpg_data

GPG key with which to check bundle signatures, or None to use the key embedded in the bundle (if any)

§Returns

true on success; false with error set on failure.

source

fn add_install_flatpakref(&self, flatpakref_data: &Bytes) -> Result<(), Error>

Adds installing the given flatpakref to this transaction.

§flatpakref_data

data from a flatpakref file

§Returns

true on success; false with error set on failure.

source

fn add_sideload_repo(&self, path: &str)

Adds an extra local ostree repo as source for installation. This is equivalent to using the sideload-repos directories (see flatpak(1)), but can be done dynamically. Any path added here is used in addition to ones in those directories.

§path

a path to a local flatpak repository

source

fn add_uninstall(&self, ref_: &str) -> Result<(), Error>

Adds uninstalling the given ref to this transaction. If the transaction is set to not deploy updates, the request is ignored.

§ref_

the ref

§Returns

true on success; false with error set on failure.

source

fn add_update( &self, ref_: &str, subpaths: &[&str], commit: Option<&str>, ) -> Result<(), Error>

Adds updating the given ref to this transaction.

§ref_

the ref

§subpaths

subpaths to install; None to use the current set plus the set of configured languages, or { NULL } or { "", NULL } to pull all subpaths.

§commit

the commit to update to, or None to use the latest

§Returns

true on success; false with error set on failure.

source

fn complete_basic_auth( &self, id: u32, user: &str, password: &str, options: &Variant, )

Finishes (or aborts) an ongoing basic auth request.

§id

The webflow id, as passed into the webflow-start signal

§user

The user name, or None if aborting request

§password

The password

§options

Extra a{sv] variant with options (or None), currently unused.

source

fn is_auto_install_debug(&self) -> bool

Gets the value set by set_auto_install_debug().

§Returns

true if auto_install_debug is set, false otherwise

source

fn is_auto_install_sdk(&self) -> bool

Gets the value set by set_auto_install_sdk().

§Returns

true if auto_install_sdk is set, false otherwise

source

fn current_operation(&self) -> Option<TransactionOperation>

Gets the current operation.

§Returns

the current TransactionOperation

source

fn is_include_unused_uninstall_ops(&self) -> bool

Gets the value set by set_include_unused_uninstall_ops().

§Returns

true if include_unused_uninstall_ops is set, false otherwise

source

fn installation(&self) -> Option<Installation>

Gets the installation this transaction was created for.

§Returns

a Installation

source

fn is_no_deploy(&self) -> bool

Gets whether the transaction is only downloading updates, and not deploying them.

§Returns

true if no_deploy is set, false otherwise

source

fn is_no_interaction(&self) -> bool

Gets whether the transaction is interactive. See set_no_interaction().

§Returns

true if the transaction is not interactive, false otherwise

source

fn is_no_pull(&self) -> bool

Gets whether the transaction should operate only on locally available data.

§Returns

true if no_pull is set, false otherwise

source

fn operation_for_ref( &self, remote: Option<&str>, ref_: &str, ) -> Result<TransactionOperation, Error>

source

fn operations(&self) -> Vec<TransactionOperation>

Gets the list of operations. Skipped operations are not included. The order of the list is the order in which the operations are executed.

§Returns

a GList of operations

source

fn parent_window(&self) -> Option<GString>

Gets the parent window set for this transaction, or None if unset. See parent_window().

§Returns

a window name, or None

source

fn is_empty(&self) -> bool

Returns whether the transaction contains any non-skipped operations.

§Returns

true if the transaction is empty

source

fn run(&self, cancellable: Option<&impl IsA<Cancellable>>) -> Result<(), Error>

Executes the transaction.

During the course of the execution, various signals will get emitted. The FlatpakTransaction::choose-remote-for-ref and add-new-remote signals may get emitted while resolving operations. ready is emitted when the transaction has been fully resolved, and new-operation and operation-done are emitted while the operations are carried out. If an error occurs at any point during the execution, operation-error is emitted.

Note that this call blocks until the transaction is done.

§cancellable

a gio::Cancellable

§Returns

true on success, false if an error occurred

source

fn set_auto_install_debug(&self, auto_install_debug: bool)

When this is set to true, Flatpak will automatically install the debug info for each app currently being installed or updated, as well as its dependencies. Does nothing if an uninstall is taking place.

§auto_install_debug

whether to auto install debug info for apps

source

fn set_auto_install_sdk(&self, auto_install_sdk: bool)

When this is set to true, Flatpak will automatically install the SDK for each app currently being installed or updated. Does nothing if an uninstall is taking place.

§auto_install_sdk

whether to auto install SDKs for apps

source

fn set_default_arch(&self, arch: &str)

Sets the architecture to default to where it is unspecified.

§arch

the arch to make default

source

fn set_disable_auto_pin(&self, disable_pin: bool)

Normally the transaction pins any explicit installations so they will not be automatically removed. But this can be disabled if you don’t want this behaviour.

§disable_pin

whether to disable auto-pinning

source

fn set_disable_dependencies(&self, disable_dependencies: bool)

Sets whether the transaction should ignore runtime dependencies when resolving operations for applications.

§disable_dependencies

whether to disable runtime dependencies

source

fn set_disable_prune(&self, disable_prune: bool)

Sets whether the transaction should avoid pruning the local OSTree repository after updating.

§disable_prune

whether to avoid pruning

Sets whether the transaction should avoid adding related refs when resolving operations. Related refs are extensions that are suggested by apps, such as locales.

whether to avoid adding related refs

source

fn set_disable_static_deltas(&self, disable_static_deltas: bool)

Sets whether the transaction should avoid using static deltas when pulling.

§disable_static_deltas

whether to avoid static deltas

source

fn set_force_uninstall(&self, force_uninstall: bool)

Sets whether the transaction should uninstall files even if they’re used by a running application.

§force_uninstall

whether to force-uninstall refs

source

fn set_include_unused_uninstall_ops(&self, include_unused_uninstall_ops: bool)

When this is set to true, Flatpak will add uninstall operations to the transaction for each runtime it considers unused. This is used by the “update” CLI command to garbage collect runtimes and free disk space.

No guarantees are made about the exact hueristic used; e.g. only end-of-life unused runtimes may be uninstalled with this set. To see the full list of unused runtimes in an installation, use InstallationExt::list_unused_refs().

§include_unused_uninstall_ops

whether to include unused uninstall ops

source

fn set_no_deploy(&self, no_deploy: bool)

Sets whether the transaction should download updates, but not deploy them.

§no_deploy

whether to avoid deploying

source

fn set_no_interaction(&self, no_interaction: bool)

This method can be used to prevent interactive authorization dialogs to appear for operations on self. This is useful for background operations that are not directly triggered by a user action.

By default, the setting from the parent Installation is used.

§no_interaction

Whether to disallow interactive authorization for operations

source

fn set_no_pull(&self, no_pull: bool)

Sets whether the transaction should operate only on locally available data.

§no_pull

whether to avoid pulls

source

fn set_parent_window(&self, parent_window: &str)

Sets the parent window (if any) to use for any UI show by this transaction. This is used by authenticators if they need to interact with the user during authentication.

The format of this string depends on the display system in use, and is the same as used by xdg-desktop-portal.

On X11 it should be of the form x11:$xid where $xid is the hex version of the xwindows id.

On wayland is should be wayland:$handle where handle is gotten by using the export call of the xdg-foreign-unstable wayland extension.

§parent_window

whether to avoid pulls

source

fn set_reinstall(&self, reinstall: bool)

Sets whether the transaction should uninstall first if a ref is already installed.

§reinstall

whether to reinstall refs

source

fn connect_add_new_remote<F: Fn(&Self, TransactionRemoteReason, &str, &str, &str) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::add-new-remote signal gets emitted if, as part of the transaction, it is required or recommended that a new remote is added, for the reason described in reason.

§reason

A TransactionRemoteReason for this suggestion

§from_id

The id of the app/runtime

§suggested_remote_name

The suggested remote name

§url

The repo url

§Returns

true to add the remote

source

fn connect_basic_auth_start<F: Fn(&Self, &str, &str, &Variant, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::basic-auth-start signal gets emitted when a basic user/password authentication is needed during the operation. If the caller handles this it should ask the user for the user and password and return true. Once the information is gathered call complete_basic_auth() with it.

If the client does not support basic auth then return false from this signal (or don’t implement it). This will abort the authentication and likely result in the transaction failing (unless the authentication was somehow optional).

§remote

The remote we’re authenticating with

§realm

The url to show

§options

Extra options, currently unused

§id

The id of the operation, can be used to finish it

source

fn connect_end_of_lifed<F: Fn(&Self, &str, &str, &str) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::end-of-lifed signal gets emitted when a ref is found to be marked as end-of-life during the execution of the transaction.

§ref_

The ref we are installing

§reason

The eol reason, or None

§rebase

The new name, if rebased, or None

source

fn connect_install_authenticator<F: Fn(&Self, &str, &str) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::install-authenticator signal gets emitted if, as part of resolving the transaction, we need to use an authenticator, but the authentication is not installed, but is available to be installed from the ref.

The application can handle this signal, and if so create another transaction to install the authenticator.

The default handler does nothing, and if the authenticator is not installed when the signal handler fails the transaction will error out.

§remote

The remote name

§authenticator_ref

The ref for the authenticator

source

fn connect_new_operation<F: Fn(&Self, &TransactionOperation, &TransactionProgress) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::new-operation signal gets emitted during the execution of the transaction when a new operation is beginning.

§operation

The new TransactionOperation

§progress

A TransactionProgress for operation

source

fn connect_ready<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId

The ::ready signal is emitted when all the refs involved in the operation have been resolved to commits, and the required authentication for all ops is gotten. At this point operations() will return all the operations that will be executed as part of the transaction.

§Returns

true to carry on with the transaction, false to abort

source

fn connect_ready_pre_auth<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::ready-pre-auth signal is emitted when all the refs involved in the transaction have been resolved to commits, but we might not necessarily have asked for authentication for all their required operations. This is very similar to the ::ready signal, and you can choose which one (or both) to use depending on how you want to handle authentication in your user interface.

At this point operations() will return all the operations that will be executed as part of the transaction. You can call TransactionOperation::requires_authentication() to see which will require authentication.

§Returns

true to carry on with the transaction, false to abort

source

fn connect_webflow_done<F: Fn(&Self, &Variant, i32) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::webflow-done signal gets emitted when the authentication finished the webflow, independent of the reason and results. If you for were showing a web-browser window it can now be closed.

§options

Extra options, currently unused

§id

The id of the operation

source

fn connect_webflow_start<F: Fn(&Self, &str, &str, &Variant, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::webflow-start signal gets emitted when some kind of user authentication is needed during the operation. If the caller handles this it should show the url in a webbrowser and return true. This will eventually cause the webbrowser to finish the authentication operation and operation will continue, as signaled by the webflow-done being emitted.

If the client does not support webflow then return false from this signal (or don’t implement it). This will abort the authentication and likely result in the transaction failing (unless the authentication was somehow optional).

During the time between webflow-start and webflow-done the client can call abort_webflow() to manually abort the authentication. This is useful if the user aborted the authentication operation some way, like e.g. closing the browser window.

§remote

The remote we’re authenticating with

§url

The url to show

§options

Extra options, currently unused

§id

The id of the operation, can be used to cancel it

source

fn connect_no_interaction_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§