pub enum Deb822Action {
Show 15 variants
SetField {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
value: String,
},
SetFieldWithIndent {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
value: String,
indent: IndentPattern,
},
RemoveField {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
},
RenameField {
file: PathBuf,
paragraph: ParagraphSelector,
from: String,
to: String,
},
RemoveParagraph {
file: PathBuf,
paragraph: ParagraphSelector,
},
AppendParagraph {
file: PathBuf,
fields: Vec<(String, String)>,
indent: Option<usize>,
},
NormalizeFieldSpacing {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
},
DropRelation {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
package: String,
},
ReplaceRelation {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
from_package: String,
to_entry: String,
},
EnsureSubstvar {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
substvar: String,
},
DropSubstvar {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
substvar: String,
},
EnsureRelation {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
entry: String,
},
SetRelationVersionConstraint {
file: PathBuf,
paragraph: ParagraphSelector,
field: String,
package: String,
constraint: Option<(VersionConstraint, Version)>,
},
MoveRelation {
file: PathBuf,
paragraph: ParagraphSelector,
from_field: String,
to_field: String,
package: String,
},
ReorderParagraphs {
file: PathBuf,
key_field: String,
order: Vec<String>,
},
}Expand description
Edits to a deb822 file.
Variants§
SetField
Set a field value, inserting it if missing.
Continuation-line indentation for multi-line values follows the
deb822 default: align continuations to the field-name column. Use
SetFieldWithIndent when a field
needs a specific indent (e.g. Description / DEP-5 mandate a
single-space indent).
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
SetFieldWithIndent
Like SetField, but with an explicit
continuation-line indent pattern. Used for fields whose
formatting convention diverges from the deb822 default — most
notably binary-package Description: (single-space indent per
DEP-5) and debian/copyright bodies.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
indent: IndentPatternContinuation-line indent pattern.
RemoveField
Remove a field if present.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
RenameField
Rename a field, preserving its value.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
RemoveParagraph
Remove the paragraph identified by paragraph.
Fields
paragraph: ParagraphSelectorWhich paragraph to drop.
AppendParagraph
Append a new paragraph at the end of the file with the given (field, value) pairs in order.
Fields
NormalizeFieldSpacing
Normalize the whitespace around a field’s separator (: and the
continuation indent). The deb822 spec allows arbitrary spacing
after the colon, but the convention is exactly one space; this
action collapses unusual spacing without otherwise touching the
value. A no-op if the field already has canonical spacing.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
DropRelation
Drop every relation matching package from a relations field
(Depends, Build-Depends, etc.). Empty alternative groups are
removed; if the field becomes empty it is removed entirely. A
no-op if the package isn’t named in the field.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
ReplaceRelation
Replace the first relation that names from_package with the
to_entry text, keeping the entry’s position in the field. A
no-op if from_package isn’t named. If to_entry parses as a
relation whose package is already named elsewhere in the field,
the original from_package entry is dropped without inserting a
duplicate.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
EnsureSubstvar
Ensure a substvar (${...}) is present in a relations field. If
the field doesn’t exist it’s created with just the substvar; if
it exists and already mentions the substvar it’s a no-op.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
DropSubstvar
Drop a substvar (${...}) from a relations field. If the field
becomes empty it’s removed entirely. A no-op if the substvar is
already absent.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
EnsureRelation
Ensure a relation entry is present in a relations field, creating
the field if necessary. entry is a literal relation entry string
(e.g. python3-poetry-core or debhelper-compat (= 13)).
If entry carries no version constraint the action is a no-op
when any relation with the same package name is already present.
If entry has an exact version, the action upgrades any existing
relation to that exact version.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
SetRelationVersionConstraint
Set the version constraint on every relation in field that names
package. Acts per-relation, so the constraint is replaced without
removing the package from the field or affecting any alternatives in
the same entry. Passing None drops the constraint entirely. A no-op
if the package isn’t named in field or every matching relation
already has the requested constraint.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
constraint: Option<(VersionConstraint, Version)>New constraint, or None to strip the constraint entirely.
MoveRelation
Move a relation entry between two fields of the same paragraph,
preserving its version constraint and any alternatives. The entry
is identified by package. If from_field becomes empty after
the move it is removed entirely. A no-op if the package isn’t
present in from_field.
Fields
paragraph: ParagraphSelectorWhich paragraph to edit.
ReorderParagraphs
Reorder a subset of paragraphs in a deb822 file. Paragraphs that
have key_field are pulled out and re-inserted in the order
given by order (which lists their key_field values). Other
paragraphs stay in place: the i-th slot occupied by a
participating paragraph in the original document is filled by
the i-th key from order. Keys in order that aren’t present
in the document are skipped.
Trait Implementations§
Source§impl Clone for Deb822Action
impl Clone for Deb822Action
Source§fn clone(&self) -> Deb822Action
fn clone(&self) -> Deb822Action
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Deb822Action
impl Debug for Deb822Action
Source§impl<'de> Deserialize<'de> for Deb822Action
impl<'de> Deserialize<'de> for Deb822Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Deb822Action
impl PartialEq for Deb822Action
Source§fn eq(&self, other: &Deb822Action) -> bool
fn eq(&self, other: &Deb822Action) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Deb822Action
impl Serialize for Deb822Action
impl Eq for Deb822Action
impl StructuralPartialEq for Deb822Action
Auto Trait Implementations§
impl Freeze for Deb822Action
impl RefUnwindSafe for Deb822Action
impl Send for Deb822Action
impl Sync for Deb822Action
impl Unpin for Deb822Action
impl UnsafeUnpin for Deb822Action
impl UnwindSafe for Deb822Action
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.