pub struct DesktopEntry {
pub name: Option<String>,
pub comment: Option<String>,
pub exec: Option<String>,
pub icon: Option<String>,
pub categories: Option<String>,
pub terminal: bool,
pub extras: BTreeMap<String, String>,
}Fields§
§name: Option<String>§comment: Option<String>§exec: Option<String>§icon: Option<String>§categories: Option<String>§terminal: bool§extras: BTreeMap<String, String>Implementations§
Source§impl DesktopEntry
impl DesktopEntry
pub fn new(name: &str) -> DesktopEntry
Sourcepub fn merge(self, other: DesktopEntry) -> DesktopEntry
pub fn merge(self, other: DesktopEntry) -> DesktopEntry
Merge another DesktopEntry into self, preferring other when present
Sourcepub fn set_field(&mut self, key: &str, value: String)
pub fn set_field(&mut self, key: &str, value: String)
Set a parsed key/value pair, storing unknown keys in extras.
pub fn from_package(package: &Package) -> DesktopEntry
pub fn ensure_name(self, fallback: &str) -> DesktopEntry
Sourcepub fn sanitize(self, exec: &Path, icon: Option<&Path>) -> DesktopEntry
pub fn sanitize(self, exec: &Path, icon: Option<&Path>) -> DesktopEntry
Sanitize fields that must always be overridden
Sourcepub fn to_desktop_file(&self) -> String
pub fn to_desktop_file(&self) -> String
Render to XDG .desktop format
Trait Implementations§
Source§impl Debug for DesktopEntry
impl Debug for DesktopEntry
Source§impl Default for DesktopEntry
impl Default for DesktopEntry
Source§fn default() -> DesktopEntry
fn default() -> DesktopEntry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DesktopEntry
impl RefUnwindSafe for DesktopEntry
impl Send for DesktopEntry
impl Sync for DesktopEntry
impl Unpin for DesktopEntry
impl UnsafeUnpin for DesktopEntry
impl UnwindSafe for DesktopEntry
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
Mutably borrows from an owned value. Read more