pub struct LicenseId {
pub name: &'static str,
pub full_name: &'static str,
/* private fields */
}
Expand description
Unique identifier for a particular license
let bsd = spdx::license_id("BSD-3-Clause").unwrap();
assert!(
bsd.is_fsf_free_libre()
&& bsd.is_osi_approved()
&& !bsd.is_deprecated()
&& !bsd.is_copyleft()
);
Fields§
§name: &'static str
The short identifier for the license
full_name: &'static str
The full name of the license
Implementations§
source§impl LicenseId
impl LicenseId
sourcepub fn is_fsf_free_libre(self) -> bool
pub fn is_fsf_free_libre(self) -> bool
Returns true if the license is considered free by the FSF
assert!(spdx::license_id("GPL-2.0-only").unwrap().is_fsf_free_libre());
sourcepub fn is_osi_approved(self) -> bool
pub fn is_osi_approved(self) -> bool
Returns true if the license is OSI approved
assert!(spdx::license_id("MIT").unwrap().is_osi_approved());
sourcepub fn is_deprecated(self) -> bool
pub fn is_deprecated(self) -> bool
Returns true if the license is deprecated
assert!(spdx::license_id("wxWindows").unwrap().is_deprecated());
sourcepub fn is_copyleft(self) -> bool
pub fn is_copyleft(self) -> bool
Returns true if the license is copyleft
assert!(spdx::license_id("LGPL-3.0-or-later").unwrap().is_copyleft());
sourcepub fn is_gnu(self) -> bool
pub fn is_gnu(self) -> bool
Returns true if the license is a GNU license, which operate differently than all other SPDX license identifiers
assert!(spdx::license_id("AGPL-3.0-only").unwrap().is_gnu());
Trait Implementations§
source§impl From<LicenseId> for LicenseReq
impl From<LicenseId> for LicenseReq
source§impl Ord for LicenseId
impl Ord for LicenseId
source§impl PartialOrd for LicenseId
impl PartialOrd for LicenseId
impl Copy for LicenseId
impl Eq for LicenseId
Auto Trait Implementations§
impl Freeze for LicenseId
impl RefUnwindSafe for LicenseId
impl Send for LicenseId
impl Sync for LicenseId
impl Unpin for LicenseId
impl UnwindSafe for LicenseId
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)