Struct spdx::LicenseId [−][src]
pub struct LicenseId { pub name: &'static str, pub full_name: &'static str, // some fields omitted }
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
Returns true if the license is considered free by the FSF
assert!(spdx::license_id("GPL-2.0-only").unwrap().is_fsf_free_libre());
Returns true if the license is OSI approved
assert!(spdx::license_id("MIT").unwrap().is_osi_approved());
Returns true if the license is deprecated
assert!(spdx::license_id("wxWindows").unwrap().is_deprecated());
Returns true if the license is copyleft
assert!(spdx::license_id("LGPL-3.0-or-later").unwrap().is_copyleft());
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
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for LicenseId
impl UnwindSafe for LicenseId
Blanket Implementations
Mutably borrows from an owned value. Read more