Struct FlatpakSource

Source
pub struct FlatpakSource {
Show 32 fields pub type: Option<FlatpakSourceType>, pub commands: Option<Vec<String>>, pub dest_filename: Option<String>, pub filename: Option<String>, pub url: Option<String>, pub mirror_urls: Option<Vec<String>>, pub md5: Option<String>, pub sha1: Option<String>, pub sha256: Option<String>, pub sha512: Option<String>, pub size: Option<i64>, pub git_init: Option<bool>, pub installed_size: Option<i64>, pub revision: Option<String>, pub branch: Option<String>, pub archive_type: Option<FlatpakArchiveType>, pub commit: Option<String>, pub tag: Option<String>, pub path: Option<String>, pub paths: Option<Vec<String>>, pub use_git: Option<bool>, pub use_git_am: Option<bool>, pub options: Option<Vec<String>>, pub disable_fsckobjects: Option<bool>, pub disable_shallow_clone: Option<bool>, pub disable_submodules: Option<bool>, pub strip_components: Option<i64>, pub skip: Option<Vec<String>>, pub only_arches: Option<Vec<String>>, pub skip_arches: Option<Vec<String>>, pub dest: Option<String>, pub x_checker_data: Option<FlatpakDataCheckerConfig>,
}
Expand description

These contain a pointer to the source that will be extracted into the source directory before the build starts. They can be of several types, distinguished by the type property.

Fields§

§type: Option<FlatpakSourceType>

Defines the type of the source description.

§commands: Option<Vec<String>>

An array of shell commands. types: script, shell

§dest_filename: Option<String>

Filename to use inside the source dir. types: script, archive, file

§filename: Option<String>

The name to use for the downloaded extra data types: extra-data

§url: Option<String>

The url to the resource. types: extra-data, svn, bzr, git, archive, file

§mirror_urls: Option<Vec<String>>

A list of alternative urls that are used if the main url fails. types: archive, file

§md5: Option<String>

The md5 checksum of the file, verified after download Note that md5 is no longer considered a safe checksum, we recommend you use at least sha256. types: archive, file

§sha1: Option<String>

The sha1 checksum of the file, verified after download Note that sha1 is no longer considered a safe checksum, we recommend you use at least sha256. types: archive, file

§sha256: Option<String>

The sha256 of the resource. types: extra-data, archive, file

§sha512: Option<String>

The sha512 checksum of the file, verified after download types: archive, file

§size: Option<i64>

The size of the extra data in bytes. types: extra-data

§git_init: Option<bool>

Whether to initialise the repository as a git repository. types: archive

§installed_size: Option<i64>

The extra installed size this adds to the app (optional). types: extra-data

§revision: Option<String>

A specific revision number to use types: svn, bzr

§branch: Option<String>

The branch to use from the git repository types: git

§archive_type: Option<FlatpakArchiveType>

The type of archive if it cannot be guessed from the path. types: archive

§commit: Option<String>

The commit to use from the git repository. If branch is also specified, then it is verified that the branch/tag is at this specific commit. This is a readable way to document that you’re using a particular tag, but verify that it does not change. types: git

§tag: Option<String>

The tag to use from the git repository types: git

§path: Option<String>

The path to associated with the resource. types: git, archive, dir, patch, file

§paths: Option<Vec<String>>

An list of paths to a patch files that will be applied in the source dir, in order types: patch

§use_git: Option<bool>

Whether to use “git apply” rather than “patch” to apply the patch, required when the patch file contains binary diffs. types: patch

§use_git_am: Option<bool>

Whether to use “git am” rather than “patch” to apply the patch, required when the patch file contains binary diffs. You cannot use this at the same time as use-git. types: patch

§options: Option<Vec<String>>

Extra options to pass to the patch command. types: patch

§disable_fsckobjects: Option<bool>

Don’t use transfer.fsckObjects=1 to mirror git repository. This may be needed for some (broken) repositories. types: git

§disable_shallow_clone: Option<bool>

Don’t optimize by making a shallow clone when downloading the git repo. types: git

§disable_submodules: Option<bool>

Don’t checkout the git submodules when cloning the repository. types: git

§strip_components: Option<i64>

The number of initial pathname components to strip. defaults to 1. types: archive, patch

§skip: Option<Vec<String>>

Source files to ignore in the directory. types: dir

§only_arches: Option<Vec<String>>

If non-empty, only build the module on the arches listed. types: all

§skip_arches: Option<Vec<String>>

Don’t build on any of the arches listed. types: all

§dest: Option<String>

Directory inside the source dir where this source will be extracted. types: all

§x_checker_data: Option<FlatpakDataCheckerConfig>

Implementations§

Source§

impl FlatpakSource

Source

pub fn get_type(&self) -> Option<FlatpakSourceType>

Get the type for the Flatpak source.

Source

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

Source

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

Source

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

Source

pub fn parse_many( format: FlatpakManifestFormat, manifest_content: &str, ) -> Result<Vec<FlatpakSource>, String>

Source

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

Source

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

Source

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

Source

pub fn get_mirror_urls(&self) -> Vec<String>

Source

pub fn get_type_name(&self) -> String

Source

pub fn supports_mirror_urls(&self) -> bool

Trait Implementations§

Source§

impl Clone for FlatpakSource

Source§

fn clone(&self) -> FlatpakSource

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 FlatpakSource

Source§

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

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

impl Default for FlatpakSource

Source§

fn default() -> FlatpakSource

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

impl<'de> Deserialize<'de> for FlatpakSource

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 FlatpakSource

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 FlatpakSource

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>,