pub struct Entry(/* private fields */);
Expand description
Parse a Freedesktop entry.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn parse_file(path: impl AsRef<Path>) -> Result<Self>
pub fn parse_file(path: impl AsRef<Path>) -> Result<Self>
Parse entry from file.
If there is a parse error it’ll be return an crate::Error wrapped io::Error with the ErrorKind::Other.
Sourcepub fn has_section(&self, name: impl AsRef<str>) -> bool
pub fn has_section(&self, name: impl AsRef<str>) -> bool
Check if the entry has a section with a name
.
Sourcepub fn section<T: AsRef<str>>(&self, name: T) -> AttrSelector<'_, T>
pub fn section<T: AsRef<str>>(&self, name: T) -> AttrSelector<'_, T>
Get section with name
.
Sourcepub fn sections(&self) -> SectionIter<'_> ⓘ
pub fn sections(&self) -> SectionIter<'_> ⓘ
Iterator over sections.
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl !Send for Entry
impl !Sync for Entry
impl Unpin for Entry
impl UnwindSafe for Entry
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