license 0.3.0

A license library.
Documentation
use License;
use permissions::*;
use conditions::*;
use limitations::*;

/// The [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
#[derive(Clone, Copy, Debug, Default, Hash, Eq, PartialEq, Ord, PartialOrd)]
pub struct Apache2;

impl License for Apache2 {
    #[inline]
    fn name(&self) -> &str {
        "Apache License 2.0"
    }

    #[inline]
    fn id(&self) -> &str {
        "Apache-2.0"
    }

    #[inline]
    fn is_osi_approved(&self) -> bool {
        true
    }

    #[inline]
    fn text(&self) -> &str {
        include_str!("../files/APACHE-2")
    }

    #[inline]
    fn permissions(&self) -> Permissions {
        COMMERCIAL_USE | DISTRIBUTION | MODIFICATION | PATENT_RIGHTS | PRIVATE_USE
    }

    #[inline]
    fn conditions(&self) -> Conditions {
        LICENSE_AND_COPYRIGHT_NOTICE | DOCUMENT_CHANGES
    }

    #[inline]
    fn limitations(&self) -> Limitations {
        NO_LIABILITY | NO_TRADEMARK_RIGHTS | NO_WARRANTY
    }

    #[inline]
    fn homepage(&self) -> Option<&str> {
        Some("https://www.apache.org/licenses/LICENSE-2.0")
    }
}

impl_license!(Apache2);