Skip to main content

Entry

Struct Entry 

Source
pub struct Entry {
    name: EntryName,
    alpm_db_desc: EntryComponent,
    alpm_db_files: EntryComponent,
    alpm_install_scriptlet: Option<EntryComponent>,
    alpm_mtree: EntryComponent,
}
Expand description

The representation of an entry in an alpm-db.

Each entry is represented by a directory, containing a set of file components. File components are distinguished between mandatory ones (ALPM-MTREE, alpm-db-desc and alpm-db-files) and optional ones (alpm-install-scriptlet).

Fields§

§name: EntryName

The name of the entry.

§alpm_db_desc: EntryComponent§alpm_db_files: EntryComponent§alpm_install_scriptlet: Option<EntryComponent>§alpm_mtree: EntryComponent

Implementations§

Source§

impl Entry

Source

pub fn new(path: impl AsRef<Path>) -> Result<Self, Error>

Creates a new Entry from a path.

The path represents an [alpm-db] entry, which must contain the alpm-db-desc, alpm-db-files and ALPM-MTREE components and optionally the alpm-install-scriptlet component.

§Errors

Returns an error, if

Source

pub fn name(&self) -> &Name

Returns a reference to the Name of the entry.

Source

pub fn version(&self) -> &FullVersion

Returns a reference to the FullVersion of the entry.

Source

pub fn db_desc(&mut self) -> Result<DbDescFile, Error>

Returns the DbDescFile.

§Note

Reads from the underlying file handle and afterwards rewinds it.

§Errors

Returns an errof if

  • a new DbDescFile cannot be created from the file handle
  • the file handle cannot be rewound
  • the EntryName of the entry directory and that of the DbDescFile component do not match
Source

pub fn db_files(&mut self) -> Result<DbFiles, Error>

Returns the DbFiles.

§Note

Reads from the underlying file handle and afterwards rewinds it.

§Errors

Returns an errof if

  • a new DbFiles cannot be created from the file handle
  • the file handle cannot be rewound
Source

pub fn install_scriptlet(&mut self) -> Result<Option<String>, Error>

Returns the optional alpm-install-scriptlet as String.

§Note

Reads from the underlying file handle and afterwards rewinds it.

Returns Ok(None), if the entry has no alpm-install-scriptlet.

§Errors

Returns an errof if

Source

pub fn mtree(&mut self) -> Result<Mtree, Error>

Returns the Mtree.

§Note

Reads from the underlying file handle and afterwards rewinds it.

§Errors

Returns an errof if

  • a new Mtree cannot be created from the file handle
  • the file handle cannot be rewound

Trait Implementations§

Source§

impl Debug for Entry

Source§

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

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

impl Display for Entry

Source§

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

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

impl PartialEq for Entry

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for Entry

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

§

impl Freeze for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnsafeUnpin for Entry

§

impl UnwindSafe for Entry

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.