Struct debian_copyright::Copyright
source · pub struct Copyright(/* private fields */);Implementations§
source§impl Copyright
impl Copyright
pub fn new() -> Self
pub fn empty() -> Self
pub fn header(&self) -> Option<Header>
pub fn iter_files(&self) -> impl Iterator<Item = FilesParagraph>
pub fn iter_licenses(&self) -> impl Iterator<Item = LicenseParagraph>
sourcepub fn find_files(&self, filename: &Path) -> Option<FilesParagraph>
pub fn find_files(&self, filename: &Path) -> Option<FilesParagraph>
Returns the Files paragraph for the given filename.
Consistent with the specification, this returns the last paragraph that matches (which should be the most specific)
pub fn find_license_by_name(&self, name: &str) -> Option<License>
sourcepub fn find_license_for_file(&self, filename: &Path) -> Option<License>
pub fn find_license_for_file(&self, filename: &Path) -> Option<License>
Returns the license for the given file.
pub fn from_str_relaxed(s: &str) -> Result<(Self, Vec<String>), Error>
pub fn from_file_relaxed<P: AsRef<Path>>( path: P, ) -> Result<(Self, Vec<String>), Error>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Copyright
impl !RefUnwindSafe for Copyright
impl !Send for Copyright
impl !Sync for Copyright
impl Unpin for Copyright
impl !UnwindSafe for Copyright
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more