Skip to main content

ParsedEntry

Enum ParsedEntry 

Source
pub enum ParsedEntry {
    LineBased(Entry),
    Deb822(Entry),
}
Expand description

Parsed watch entry that can be either line-based or deb822 format

Variants§

§

LineBased(Entry)

Line-based entry (v1-4)

§

Deb822(Entry)

Deb822 entry (v5)

Implementations§

Source§

impl ParsedEntry

Source

pub fn url(&self) -> String

Get the URL/Source of the entry

Source

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

Get the matching pattern

Source

pub fn get_option(&self, key: &str) -> Option<String>

Get a generic option/field value by key (case-insensitive)

This handles the difference between line-based format (lowercase keys) and deb822 format (capitalized keys). It tries the key as-is first, then tries with the first letter capitalized.

Source

pub fn has_option(&self, key: &str) -> bool

Check if an option/field is set (case-insensitive)

Source

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

Get the script

Source

pub fn format_url( &self, package: impl FnOnce() -> String, ) -> Result<Url, ParseError>

Format the URL with package substitution

Source

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

Get the user agent

Source

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

Get the pagemangle option

Source

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

Get the uversionmangle option

Source

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

Get the downloadurlmangle option

Source

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

Get the pgpsigurlmangle option

Source

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

Get the filenamemangle option

Source

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

Get the oversionmangle option

Source

pub fn searchmode(&self) -> SearchMode

Get the searchmode, with default fallback

Trait Implementations§

Source§

impl Debug for ParsedEntry

Source§

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

Formats the value using the given formatter. 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, 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.