pub enum ParagraphSelector {
Source,
Binary {
package: String,
},
CopyrightHeader,
CopyrightFiles {
glob: String,
},
CopyrightLicense {
name: String,
},
Index {
index: usize,
},
ByKey {
field: String,
value: String,
},
}Expand description
Identifies a paragraph in a deb822 file.
The variants are a union of file-format vocabularies. Each variant is
labelled with the family of files it applies to; the applier validates
that a selector matches the file it’s targeting (e.g.
Binary on debian/copyright is an error).
File-format-agnostic selectors (Index,
ByKey) work on any deb822 file, including ones we
don’t have a typed wrapper for.
Variants§
Source
debian/control: the source paragraph.
Binary
debian/control: a binary paragraph identified by its Package: field.
CopyrightHeader
debian/copyright: the header paragraph (carrying Format:,
Upstream-Name:, etc.).
CopyrightFiles
debian/copyright: the paragraph whose Files: field matches the
given glob string exactly.
CopyrightLicense
debian/copyright: a standalone License paragraph (no Files: field)
whose License synopsis equals name.
Fields
Index
File-format-agnostic: the Nth paragraph (0-indexed). Use sparingly: indices shift as paragraphs are inserted or removed.
ByKey
File-format-agnostic: the first paragraph whose field has exactly
the given value.
Trait Implementations§
Source§impl Clone for ParagraphSelector
impl Clone for ParagraphSelector
Source§fn clone(&self) -> ParagraphSelector
fn clone(&self) -> ParagraphSelector
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 ParagraphSelector
impl Debug for ParagraphSelector
Source§impl<'de> Deserialize<'de> for ParagraphSelector
impl<'de> Deserialize<'de> for ParagraphSelector
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>,
impl Eq for ParagraphSelector
Source§impl PartialEq for ParagraphSelector
impl PartialEq for ParagraphSelector
Source§fn eq(&self, other: &ParagraphSelector) -> bool
fn eq(&self, other: &ParagraphSelector) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ParagraphSelector
impl Serialize for ParagraphSelector
impl StructuralPartialEq for ParagraphSelector
Auto Trait Implementations§
impl Freeze for ParagraphSelector
impl RefUnwindSafe for ParagraphSelector
impl Send for ParagraphSelector
impl Sync for ParagraphSelector
impl Unpin for ParagraphSelector
impl UnsafeUnpin for ParagraphSelector
impl UnwindSafe for ParagraphSelector
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.