Skip to main content

Package

Struct Package 

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

A package in the APT package manager.

Implementations§

Source§

impl Package

Source

pub fn new(paragraph: Paragraph) -> Self

Create a new package.

Source

pub fn parse(text: &str) -> Parse<Package>

Parse package text, returning a Parse result

Note: This expects a single paragraph, not a full deb822 document

Source

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

Get the name of the package.

Source

pub fn set_name(&mut self, name: &str)

Set the name of the package.

Source

pub fn version(&self) -> Option<Version>

Get the version of the package.

Source

pub fn set_version(&mut self, version: Version)

Set the version of the package.

Source

pub fn installed_size(&self) -> Option<usize>

Get the installed size of the package in bytes.

Source

pub fn set_installed_size(&mut self, size: usize)

Set the installed size of the package in bytes.

Source

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

Get the maintainer of the package.

Source

pub fn set_maintainer(&mut self, maintainer: &str)

Set the maintainer of the package.

Source

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

Get the architecture of the package.

Source

pub fn set_architecture(&mut self, arch: &str)

Set the architecture of the package.

Source

pub fn depends(&self) -> Option<Relations>

Get the packages that this package depends on.

Source

pub fn set_depends(&mut self, relations: Relations)

Set the packages that this package depends on.

Source

pub fn recommends(&self) -> Option<Relations>

Get the packages that this package suggests.

Source

pub fn set_recommends(&mut self, relations: Relations)

Set the packages that this package recommends.

Source

pub fn suggests(&self) -> Option<Relations>

Get the packages that this package suggests.

Source

pub fn set_suggests(&mut self, relations: Relations)

Set the packages that this package suggests.

Source

pub fn enhances(&self) -> Option<Relations>

Get the packages that this package enhances.

Source

pub fn set_enhances(&mut self, relations: Relations)

Set the packages that this package enhances.

Source

pub fn pre_depends(&self) -> Option<Relations>

Get the relations that this package pre-depends on.

Source

pub fn set_pre_depends(&mut self, relations: Relations)

Set the relations that this package pre-depends on.

Source

pub fn breaks(&self) -> Option<Relations>

Get the relations that this package breaks.

Source

pub fn set_breaks(&mut self, relations: Relations)

Set the relations that this package breaks.

Source

pub fn conflicts(&self) -> Option<Relations>

Get the relations that this package conflicts with.

Source

pub fn set_conflicts(&mut self, relations: Relations)

Set the relations that this package conflicts with.

Source

pub fn replaces(&self) -> Option<Relations>

Get the relations that this package replaces.

Source

pub fn set_replaces(&mut self, relations: Relations)

Set the relations that this package replaces.

Source

pub fn provides(&self) -> Option<Relations>

Get the relations that this package provides.

Source

pub fn set_provides(&mut self, relations: Relations)

Set the relations that the package provides.

Source

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

Get the section of the package.

Source

pub fn set_section(&mut self, section: &str)

Set the section of the package.

Source

pub fn priority(&self) -> Option<Priority>

Get the priority of the package.

Source

pub fn set_priority(&mut self, priority: Priority)

Set the priority of the package.

Source

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

Get the description of the package.

Source

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

Set the description of the package.

Source

pub fn homepage(&self) -> Option<Url>

Get the upstream homepage of the package.

Source

pub fn set_homepage(&mut self, url: &Url)

Set the upstream homepage of the package.

Source

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

Get the source of the package.

Source

pub fn set_source(&mut self, source: &str)

Set the source of the package.

Source

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

Get the MD5 checksum of the description.

Source

pub fn set_description_md5(&mut self, md5: &str)

Set the MD5 checksum of the description.

Source

pub fn tags(&self, tag: &str) -> Option<Vec<String>>

Get the tags of the package.

Source

pub fn set_tags(&mut self, tag: &str, tags: Vec<String>)

Set the tags of the package.

Source

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

Get the filename of the package.

Source

pub fn set_filename(&mut self, filename: &str)

Set the filename of the package.

Source

pub fn size(&self) -> Option<usize>

Get the size of the package.

Source

pub fn set_size(&mut self, size: usize)

Set the size of the package.

Source

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

Get the MD5 checksum.

Source

pub fn set_md5sum(&mut self, md5sum: &str)

Set the MD5 checksum.

Source

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

Get the SHA256 checksum.

Source

pub fn set_sha256(&mut self, sha256: &str)

Set the SHA256 checksum.

Source

pub fn multi_arch(&self) -> Option<MultiArch>

Get the multi-arch field.

Source

pub fn set_multi_arch(&mut self, arch: MultiArch)

Set the multi-arch field.

Trait Implementations§

Source§

impl AstNode for Package

Source§

type Language = Lang

Source§

fn can_cast(kind: <Self::Language as Language>::Kind) -> bool

Source§

fn cast(syntax: SyntaxNode<Self::Language>) -> Option<Self>

Source§

fn syntax(&self) -> &SyntaxNode<Self::Language>

Source§

fn clone_for_update(&self) -> Self
where Self: Sized,

Source§

fn clone_subtree(&self) -> Self
where Self: Sized,

Source§

impl Clone for Package

Source§

fn clone(&self) -> Package

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Package

Source§

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

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

impl FromStr for Package

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
Source§

impl PartialEq for Package

Source§

fn eq(&self, other: &Package) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Package

Source§

impl StructuralPartialEq for Package

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.