FilesSection

Struct FilesSection 

Source
pub(crate) struct FilesSection(Vec<PathBuf>);
Expand description

The raw data section in alpm-files data.

Tuple Fields§

§0: Vec<PathBuf>

Implementations§

Source§

impl FilesSection

Source

pub(crate) const SECTION_KEYWORD: &str = "%FILES%"

The section keyword (“%FILES%”).

Source

fn parse_path(input: &mut &str) -> ModalResult<PathBuf>

Recognizes a PathBuf in a single line.

§Note

This parser only consumes till the end of a line and attempts to parse a PathBuf from it. Trailing line endings and EOF are handled.

§Errors

Returns an error if a PathBuf cannot be created from the line, or something other than a line ending or EOF is encountered afterwards.

Source

pub(crate) fn parser(input: &mut &str) -> ModalResult<Self>

Recognizes alpm-files data in a string slice.

§Errors

Returns an error, if

  • input is not empty and the first line does not contain the required section header “%FILES%”,
  • or there are lines following the section header, but they cannot be parsed as a Vec of PathBuf.
Source

pub fn paths(self) -> Vec<PathBuf>

Returns the paths.

Trait Implementations§

Source§

impl Debug for FilesSection

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.

§

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, 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.