pub struct Desktop(/* private fields */);Expand description
The root of an INI/.desktop file
Implementations§
Source§impl Desktop
impl Desktop
Sourcepub fn groups(&self) -> impl Iterator<Item = Group>
pub fn groups(&self) -> impl Iterator<Item = Group>
Get all groups in the file
Examples found in repository?
examples/test_parse.rs (line 17)
4fn main() {
5 let input = r###"[Desktop Entry]
6Name=Example Application
7Type=Application
8Exec=example
9# This is a comment
10Icon=example.png
11"###;
12
13 println!("Input:\n{}", input);
14 println!("\nParsing...");
15 match Desktop::from_str(input) {
16 Ok(desktop) => {
17 println!("Success! Groups: {}", desktop.groups().count());
18 for group in desktop.groups() {
19 println!("Group: {:?}", group.name());
20 }
21 }
22 Err(e) => {
23 println!("Error: {}", e);
24 }
25 }
26}Sourcepub fn syntax(&self) -> &SyntaxNode<Lang>
pub fn syntax(&self) -> &SyntaxNode<Lang>
Get the raw syntax node
Trait Implementations§
impl Eq for Desktop
impl StructuralPartialEq for Desktop
Auto Trait Implementations§
impl Freeze for Desktop
impl !RefUnwindSafe for Desktop
impl !Send for Desktop
impl !Sync for Desktop
impl Unpin for Desktop
impl !UnwindSafe for Desktop
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