pub struct WatchFile(/* private fields */);Expand description
A watch file in format 5 (RFC822/deb822 style)
Implementations§
Source§impl WatchFile
impl WatchFile
Sourcepub fn defaults(&self) -> Option<Paragraph>
pub fn defaults(&self) -> Option<Paragraph>
Returns the defaults paragraph if it exists. The defaults paragraph is the second paragraph (after Version) if it has no Source field.
Sourcepub fn entries(&self) -> impl Iterator<Item = Entry> + '_
pub fn entries(&self) -> impl Iterator<Item = Entry> + '_
Returns an iterator over all entries in the watch file. The first paragraph contains defaults, subsequent paragraphs are entries.
Sourcepub fn inner_mut(&mut self) -> &mut Deb822
pub fn inner_mut(&mut self) -> &mut Deb822
Get a mutable reference to the underlying Deb822 object
Sourcepub fn add_entry(&mut self, source: &str, matching_pattern: &str) -> Entry
pub fn add_entry(&mut self, source: &str, matching_pattern: &str) -> Entry
Add a new entry to the watch file with the given source and matching pattern. Returns the newly created Entry.
§Example
use debian_watch::deb822::WatchFile;
use debian_watch::WatchOption;
let mut wf = WatchFile::new();
let mut entry = wf.add_entry("https://github.com/foo/bar/tags", ".*/v?([\\d.]+)\\.tar\\.gz");
entry.set_option(WatchOption::Component("upstream".to_string()));Trait Implementations§
Auto Trait Implementations§
impl Freeze for WatchFile
impl !RefUnwindSafe for WatchFile
impl !Send for WatchFile
impl !Sync for WatchFile
impl Unpin for WatchFile
impl UnsafeUnpin for WatchFile
impl !UnwindSafe for WatchFile
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