pub enum Kind {
Agpl3(Agpl3),
Apache2(Apache2),
Cc01(Cc01),
Gpl3(Gpl3),
Lgpl3(Lgpl3),
Mit(Mit),
Mpl2(Mpl2),
Unlicense(Unlicense),
}
Expand description
Enum containing all supported licenses.
Examples
use std::str::FromStr;
use license::*;
// From the license text:
let apache2 = Kind::from_str(include_str!("../files/APACHE-2"));
assert_eq!(apache2, Ok(Kind::Apache2(Apache2)));
// From the license id:
let gpl3 = Kind::from_str("GPL-3.0-only");
assert_eq!(gpl3, Ok(Kind::Gpl3(Gpl3)));
Variants§
Agpl3(Agpl3)
Apache2(Apache2)
The Apache License 2.0.
Cc01(Cc01)
Gpl3(Gpl3)
Lgpl3(Lgpl3)
Mit(Mit)
The MIT License.
Mpl2(Mpl2)
Unlicense(Unlicense)
The Unlicense.
Implementations§
source§impl Kind
impl Kind
sourcepub fn is_apache2(&self) -> bool
pub fn is_apache2(&self) -> bool
Returns true
if the license is Apache2
.
sourcepub fn is_unlicense(&self) -> bool
pub fn is_unlicense(&self) -> bool
Returns true
if the license is Unlicense
.
Trait Implementations§
source§impl License for Kind
impl License for Kind
source§fn permissions(&self) -> Permissions
fn permissions(&self) -> Permissions
The permissions of the license.
source§fn conditions(&self) -> Conditions
fn conditions(&self) -> Conditions
The conditions of the license.
source§fn limitations(&self) -> Limitations
fn limitations(&self) -> Limitations
The limitations of the license.
source§fn is_osi_approved(&self) -> bool
fn is_osi_approved(&self) -> bool
Says if the license is OSI approved. Read more
source§fn is_fsf_free(&self) -> bool
fn is_fsf_free(&self) -> bool
Says if the license is FSF Free. Read more
source§impl Ord for Kind
impl Ord for Kind
source§impl PartialOrd<Kind> for Kind
impl PartialOrd<Kind> for Kind
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more