pub struct ControlFileParser { /* private fields */ }Expand description
Holds parsing state for Debian control files.
Instances of this type are essentially fed lines of text and periodically emit ControlParagraph instances as they are completed.
Implementations§
Source§impl ControlFileParser
impl ControlFileParser
Sourcepub fn write_line(
&mut self,
line: &str,
) -> Result<Option<ControlParagraph<'static>>>
pub fn write_line( &mut self, line: &str, ) -> Result<Option<ControlParagraph<'static>>>
Write a line to the parser.
If the line terminates an in-progress paragraph, that paragraph will be returned.
Otherwise Ok(None) is returned.
Err is returned if the control file in invalid.
Sourcepub fn finish(self) -> Result<Option<ControlParagraph<'static>>>
pub fn finish(self) -> Result<Option<ControlParagraph<'static>>>
Finish parsing, consuming self.
If a non-empty paragraph is present in the instance, it will be returned. Else if there is no unflushed state, None is returned.
Trait Implementations§
Source§impl Clone for ControlFileParser
impl Clone for ControlFileParser
Source§fn clone(&self) -> ControlFileParser
fn clone(&self) -> ControlFileParser
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ControlFileParser
impl Debug for ControlFileParser
Source§impl Default for ControlFileParser
impl Default for ControlFileParser
Source§fn default() -> ControlFileParser
fn default() -> ControlFileParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ControlFileParser
impl RefUnwindSafe for ControlFileParser
impl Send for ControlFileParser
impl Sync for ControlFileParser
impl Unpin for ControlFileParser
impl UnwindSafe for ControlFileParser
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