Struct debian_analyzer::control::TemplatedControlEditor
source · pub struct TemplatedControlEditor { /* private fields */ }Expand description
An editor for a control file that may be generated from a template.
This editor will automatically expand the template if it does not exist. It will also automatically update the template if the control file is changed.
§Example
use std::path::Path;
use debian_analyzer::control::TemplatedControlEditor;
let td = tempfile::tempdir().unwrap();
let mut editor = TemplatedControlEditor::create(td.path().join("control")).unwrap();
editor.add_source("foo").set_architecture(Some("all"));
editor.commit().unwrap();Implementations§
source§impl TemplatedControlEditor
impl TemplatedControlEditor
pub fn create<P: AsRef<Path>>(control_path: P) -> Result<Self, EditorError>
pub fn template_type(&self) -> Option<TemplateType>
pub fn open<P: AsRef<Path>>(control_path: P) -> Result<Self, EditorError>
pub fn new<P: AsRef<Path>>( control_path: P, allow_missing: bool, ) -> Result<Self, EditorError>
Trait Implementations§
source§impl DerefMut for TemplatedControlEditor
impl DerefMut for TemplatedControlEditor
Auto Trait Implementations§
impl Freeze for TemplatedControlEditor
impl !RefUnwindSafe for TemplatedControlEditor
impl !Send for TemplatedControlEditor
impl !Sync for TemplatedControlEditor
impl Unpin for TemplatedControlEditor
impl !UnwindSafe for TemplatedControlEditor
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