PatchHeader

Struct PatchHeader 

Source
pub struct PatchHeader(/* private fields */);
Expand description

A Debian patch header.

Implementations§

Source§

impl PatchHeader

Source

pub fn new() -> Self

Create a new, empty patch header.

Source

pub fn as_deb822(&self) -> &Paragraph

Get a reference to the underlying Paragraph.

Source

pub fn as_deb822_mut(&mut self) -> &mut Paragraph

Get a mutable reference to the underlying Paragraph, mutably.

Source

pub fn origin(&self) -> Option<(Option<OriginCategory>, Origin)>

The origin of the patch.

Source

pub fn set_origin(&mut self, category: Option<OriginCategory>, origin: Origin)

Set the origin of the patch.

Source

pub fn forwarded(&self) -> Option<Forwarded>

The Forwarded field.

Source

pub fn set_forwarded(&mut self, forwarded: Forwarded)

Set the Forwarded field.

Source

pub fn author(&self) -> Option<String>

The author of the patch.

Source

pub fn set_author(&mut self, author: &str)

Set the author of the patch.

Source

pub fn reviewed_by(&self) -> Vec<String>

The Reviewed-By field.

Source

pub fn last_update(&self) -> Option<NaiveDate>

Get the last update date of the patch.

Source

pub fn set_last_update(&mut self, date: NaiveDate)

Set the date of the last update

Source

pub fn applied_upstream(&self) -> Option<AppliedUpstream>

The Applied-Upstream field.

Source

pub fn set_applied_upstream(&mut self, applied_upstream: AppliedUpstream)

Set the Applied-Upstream field.

Source

pub fn bugs(&self) -> impl Iterator<Item = (Option<String>, String)> + '_

Get the bugs associated with the patch.

Source

pub fn vendor_bugs<'a>( &'a self, vendor: &'a str, ) -> impl Iterator<Item = String> + 'a

Get the bugs associated with a specific vendor.

Source

pub fn set_upstream_bug(&mut self, bug: &str)

Set the upstream bug associated with the patch.

Source

pub fn set_vendor_bug(&mut self, vendor: &str, bug: &str)

Set the bug associated with a specific vendor.

Source

pub fn description(&self) -> Option<String>

Get the description of the patch.

Source

pub fn set_description(&mut self, description: &str)

Set the description of the patch.

Source

pub fn long_description(&self) -> Option<String>

Get the long description of the patch.

Source

pub fn set_long_description(&mut self, long_description: &str)

Set the long description of the patch.

Source

pub fn write<W: Write>(&self, writer: &mut W) -> Result<()>

Write the patch header

Trait Implementations§

Source§

impl Default for PatchHeader

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for PatchHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromStr for PatchHeader

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.