Skip to main content

FilesParagraph

Struct FilesParagraph 

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

A files paragraph

Implementations§

Source§

impl FilesParagraph

Source

pub fn as_deb822(&self) -> &Paragraph

Return the underlying Deb822 paragraph

Source

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

List of file patterns in the paragraph

Source

pub fn set_files(&mut self, files: &[&str])

Set the file patterns in the paragraph

Source

pub fn add_file(&mut self, pattern: &str)

Add a file pattern to the paragraph

If the pattern already exists, it will not be added again.

Source

pub fn remove_file(&mut self, pattern: &str) -> bool

Remove a file pattern from the paragraph

Returns true if the pattern was found and removed, false otherwise.

Source

pub fn matches(&self, filename: &Path) -> bool

Check whether the paragraph matches the given filename

Source

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

Copyright holders in the paragraph

Set the copyright

Source

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

Comment associated with the files paragraph

Source

pub fn set_comment(&mut self, comment: &str)

Set the comment associated with the files paragraph

Source

pub fn license(&self) -> Option<License>

License in the paragraph

Source

pub fn set_license(&mut self, license: &License)

Set the license associated with the files paragraph

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.