#[non_exhaustive]pub struct DebianConfig {
pub depends: Option<Dependencies>,
pub desktop_template: Option<PathBuf>,
pub section: Option<String>,
pub priority: Option<String>,
pub files: Option<HashMap<String, String>>,
pub package_name: Option<String>,
}Expand description
The Linux Debian configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.depends: Option<Dependencies>The list of Debian dependencies.
desktop_template: Option<PathBuf>Path to a custom desktop file Handlebars template.
Available variables: categories, comment (optional), exec, icon and name.
Default file contents:
[Desktop Entry]
Categories={{categories}}
{{#if comment}}
Comment={{comment}}
{{/if}}
Exec={{exec}} {{exec_arg}}
Icon={{icon}}
Name={{name}}
Terminal=false
Type=Application
{{#if mime_type}}
MimeType={{mime_type}}
{{/if}}The {{exec_arg}} will be set to:
- “%F”, if at least one Config::file_associations was specified but no deep link protocols were given.
- The “%F” arg means that your application can be invoked with multiple file paths.
- “%U”, if at least one Config::deep_link_protocols was specified.
- The “%U” arg means that your application can be invoked with multiple URLs.
- If both Config::file_associations and Config::deep_link_protocols were specified,
the “%U” arg will be used, causing the file paths to be passed to your app as
file://URLs.
- An empty string “” (nothing) if neither are given.
- This means that your application will never be invoked with any URLs or file paths.
To specify a custom exec_arg, just use plaintext directly instead of {{exec_arg}}:
Exec={{exec}} %uSee more here: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables.
section: Option<String>Define the section in Debian Control file. See : https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
priority: Option<String>Change the priority of the Debian Package. By default, it is set to optional.
Recognized Priorities as of now are : required, important, standard, optional, extra
files: Option<HashMap<String, String>>List of custom files to add to the deb package. Maps a dir/file to a dir/file inside the debian package.
package_name: Option<String>Name to use for the Package field in the Debian Control file.
Defaults to Config::product_name converted to kebab-case.
Implementations§
Source§impl DebianConfig
impl DebianConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new DebianConfig.
Sourcepub fn depends<I, S>(self, depends: I) -> Self
pub fn depends<I, S>(self, depends: I) -> Self
Set the list of Debian dependencies directly using an iterator of strings.
Sourcepub fn depends_path<P>(self, path: P) -> Self
pub fn depends_path<P>(self, path: P) -> Self
Set the list of Debian dependencies indirectly via a path to a file, which must contain one dependency (a package name) per line.
Sourcepub fn desktop_template<P: Into<PathBuf>>(self, desktop_template: P) -> Self
pub fn desktop_template<P: Into<PathBuf>>(self, desktop_template: P) -> Self
Set the path to a custom desktop file Handlebars template.
Available variables: categories, comment (optional), exec, icon and name.
Default file contents:
[Desktop Entry]
Categories={{categories}}
{{#if comment}}
Comment={{comment}}
{{/if}}
Exec={{exec}} {{exec_arg}}
Icon={{icon}}
Name={{name}}
Terminal=false
Type=Application
{{#if mime_type}}
MimeType={{mime_type}}
{{/if}}Sourcepub fn section<S: Into<String>>(self, section: S) -> Self
pub fn section<S: Into<String>>(self, section: S) -> Self
Define the section in Debian Control file. See : https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
Trait Implementations§
Source§impl Clone for DebianConfig
impl Clone for DebianConfig
Source§fn clone(&self) -> DebianConfig
fn clone(&self) -> DebianConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DebianConfig
impl Debug for DebianConfig
Source§impl Default for DebianConfig
impl Default for DebianConfig
Source§fn default() -> DebianConfig
fn default() -> DebianConfig
Source§impl<'de> Deserialize<'de> for DebianConfig
impl<'de> Deserialize<'de> for DebianConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DebianConfig
impl RefUnwindSafe for DebianConfig
impl Send for DebianConfig
impl Sync for DebianConfig
impl Unpin for DebianConfig
impl UnwindSafe for DebianConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more