FlatpakApplication

Struct FlatpakApplication 

Source
pub struct FlatpakApplication {
Show 41 fields pub format: FlatpakManifestFormat, pub app_name: String, pub app_id: String, pub id: String, pub branch: String, pub default_branch: String, pub collection_id: String, pub runtime: String, pub runtime_version: String, pub sdk: String, pub sdk_extensions: Vec<String>, pub var: String, pub metadata: String, pub build_runtime: Option<bool>, pub build_extension: Option<bool>, pub base: String, pub base_version: String, pub base_extensions: Vec<String>, pub separate_locales: Option<bool>, pub appstream_compose: Option<bool>, pub inherit_extensions: Vec<String>, pub inherit_sdk_extensions: Vec<String>, pub build_options: Option<FlatpakBuildOptions>, pub command: Option<String>, pub tags: Vec<String>, pub add_extensions: BTreeMap<String, FlatpakExtension>, pub add_build_extensions: BTreeMap<String, FlatpakExtension>, pub cleanup: Vec<String>, pub cleanup_commands: Vec<String>, pub cleanup_platform: Vec<String>, pub cleanup_platform_commands: Vec<String>, pub prepare_platform_commands: Vec<String>, pub finish_args: Vec<String>, pub rename_desktop_file: String, pub rename_appdata_file: String, pub rename_icon: String, pub appdata_license: String, pub copy_icon: Option<bool>, pub desktop_file_name_prefix: String, pub desktop_file_name_suffix: String, pub modules: Vec<FlatpakModuleItem>,
}
Expand description

Main structure for a Flatpak application manifest. See man flatpak-manifest for the flatpak manifest specs.

Fields§

§format: FlatpakManifestFormat§app_name: String

Name of the application.

§app_id: String

A string defining the application id. Both names (app-id and id) are accepted.

§id: String§branch: String

The branch to use when exporting the application. If this is unset the defaults come from the default-branch option.

This key overrides both the default-branch key, and the –default-branch commandline option. Unless you need a very specific branchname (like for a runtime or an extension) it is recommended to use the default-branch key instead, because you can then override the default using –default-branch when building for instance a test build.

§default_branch: String

The default branch to use when exporting the application. Defaults to master. This key can be overridden by the –default-branch commandline option.

§collection_id: String

The collection ID of the repository, defaults to being unset. Setting a globally unique collection ID allows the apps in the repository to be shared over peer to peer systems without needing further configuration. If building in an existing repository, the collection ID must match the existing configured collection ID for that repository.

§runtime: String

The name of the runtime that the application uses.

§runtime_version: String

The version of the runtime that the application uses, defaults to master.

§sdk: String

The name of the development runtime that the application builds with.

§sdk_extensions: Vec<String>

The name of the development extensions that the application requires to build.

§var: String

Initialize the (otherwise empty) writable /var in the build with a copy of this runtime.

§metadata: String

Use this file as the base metadata file when finishing.

§build_runtime: Option<bool>

Build a new runtime instead of an application.

§build_extension: Option<bool>

Whether the manifest describes an extension to be used by other manifests. Extensions can be used to bundle programming langages and their associated tools, for example.

§base: String

Start with the files from the specified application. This can be used to create applications that extend another application.

§base_version: String

Use this specific version of the application specified in base. If unspecified, this uses the value specified in branch

§base_extensions: Vec<String>

Install these extra extensions from the base application when initializing the application directory.

§separate_locales: Option<bool>

Separate out locale files and translations to an extension runtime. Defaults to true.

§appstream_compose: Option<bool>

Run appstream-compose during cleanup phase. Defaults to true.

§inherit_extensions: Vec<String>

Inherit these extra extensions points from the base application or sdk when finishing the build.

§inherit_sdk_extensions: Vec<String>

Inherit these extra extensions points from the base application or sdk when finishing the build, but do not inherit them into the platform.

§build_options: Option<FlatpakBuildOptions>

Inherit these extra extensions points from the base application or sdk when finishing the build, but do not inherit them into the platform.

§command: Option<String>

The name of the command that the flatpak should run on execution.

§tags: Vec<String>

Add these tags to the metadata file.

§add_extensions: BTreeMap<String, FlatpakExtension>

This is a dictionary of extension objects. The key is the name of the extension.

§add_build_extensions: BTreeMap<String, FlatpakExtension>

This is a dictionary of extension objects similar to add-extensions. The main difference is that the extensions are added early and are available for use during the build.

§cleanup: Vec<String>

An array of file patterns that should be removed at the end. Patterns starting with / are taken to be full pathnames (without the /app prefix), otherwise they just match the basename.

§cleanup_commands: Vec<String>

An array of commandlines that are run during the cleanup phase.

§cleanup_platform: Vec<String>

Extra files to clean up in the platform.

§cleanup_platform_commands: Vec<String>

An array of commandlines that are run during the cleanup phase of the platform.

§prepare_platform_commands: Vec<String>

An array of commandlines that are run after importing the base platform, but before applying the new files from the sdk. This is a good place to e.g. delete things from the base that may conflict with the files added in the sdk.

§finish_args: Vec<String>

An array of arguments passed to the flatpak build-finish command.

§rename_desktop_file: String

Any desktop file with this name will be renamed to a name based on id during the cleanup phase.

§rename_appdata_file: String

Any appdata file with this name will be renamed to a name based on id during the cleanup phase.

§rename_icon: String

Any icon with this name will be renamed to a name based on id during the cleanup phase. Note that this is the icon name, not the full filenames, so it should not include a filename extension.

§appdata_license: String

Replace the appdata project-license field with this string. This is useful as the upstream license is typically only about the application itself, whereas the bundled app can contain other licenses too.

§copy_icon: Option<bool>

If rename-icon is set, keep a copy of the old icon file.

§desktop_file_name_prefix: String

This string will be prefixed to the Name key in the main application desktop file.

§desktop_file_name_suffix: String

This string will be suffixed to the Name key in the main application desktop file.

§modules: Vec<FlatpakModuleItem>

An array of strings specifying the modules to be built in order. String members in the array are interpreted as the name of a separate json or yaml file that contains a module. See below for details.

Implementations§

Source§

impl FlatpakApplication

Source

pub fn get_id(&self) -> String

Source

pub fn load_from_file(path: String) -> Result<FlatpakApplication, String>

Source

pub fn file_extension_matches(path: &str) -> bool

Source

pub fn file_path_matches(path: &str) -> bool

Source

pub fn parse( format: FlatpakManifestFormat, manifest_content: &str, ) -> Result<FlatpakApplication, String>

Source

pub fn dump(&self) -> Result<String, String>

Source

pub fn get_urls( &self, include_mirror_urls: bool, include_source_types: Option<Vec<FlatpakSourceType>>, ) -> Vec<String>

Source

pub fn get_main_module_url(&self) -> Option<String>

Source

pub fn get_max_depth(&self) -> i32

Source

pub fn is_extension(&self) -> bool

Source

pub fn get_all_modules_recursively(&self) -> Vec<&FlatpakModuleItem>

Trait Implementations§

Source§

impl Clone for FlatpakApplication

Source§

fn clone(&self) -> FlatpakApplication

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FlatpakApplication

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FlatpakApplication

Source§

fn default() -> FlatpakApplication

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FlatpakApplication

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for FlatpakApplication

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Serialize for FlatpakApplication

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,