Enum license::LicenseKind
[−]
[src]
pub enum LicenseKind {
Agpl3(Agpl3),
Apache2(Apache2),
Cc01(Cc01),
Gpl3(Gpl3),
Lgpl3(Lgpl3),
Mit(Mit),
Mpl2(Mpl2),
Unlicense(Unlicense),
}Enum containing all supported licenses.
Examples
use std::str::FromStr; use license::{Apache2, Gpl3, LicenseKind}; // From text: let apache2 = LicenseKind::from_str(include_str!("files/APACHE-2")); assert_eq!(apache2, Ok(LicenseKind::Apache2(Apache2))); // From identity: let gpl3 = LicenseKind::from_str("GPL-3.0"); assert_eq!(gpl3, Ok(LicenseKind::Gpl3(Gpl3)));
Variants
Agpl3(Agpl3)Apache2(Apache2)Cc01(Cc01)Gpl3(Gpl3)Lgpl3(Lgpl3)Mit(Mit)Mpl2(Mpl2)Unlicense(Unlicense)Trait Implementations
impl Clone for LicenseKind[src]
fn clone(&self) -> LicenseKind
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Debug for LicenseKind[src]
impl Eq for LicenseKind[src]
impl PartialEq for LicenseKind[src]
fn eq(&self, __arg_0: &LicenseKind) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &LicenseKind) -> bool
This method tests for !=.
impl Hash for LicenseKind[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl Ord for LicenseKind[src]
fn cmp(&self, __arg_0: &LicenseKind) -> Ordering
This method returns an Ordering between self and other. Read more
impl PartialOrd for LicenseKind[src]
fn partial_cmp(&self, __arg_0: &LicenseKind) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &LicenseKind) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &LicenseKind) -> bool
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, __arg_0: &LicenseKind) -> bool
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &LicenseKind) -> bool
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl License for LicenseKind[src]
fn name(&self) -> &str
The name of the license. Read more
fn id(&self) -> &str
The identifier of the license. Read more
fn is_osi_approved(&self) -> bool
Says if the license is OSI approved. Read more
fn text(&self) -> &str
The license text.
fn permissions(&self) -> Permissions
The permissions of the license.
fn conditions(&self) -> Conditions
The conditions of the license.
fn limitations(&self) -> Limitations
The limitations of the license.
fn homepage(&self) -> Option<&str>
The homepage of the license.
impl FromStr for LicenseKind[src]
type Err = Unknown
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a string s to return a value of this type. Read more