[][src]Enum oceanpkg::drop::license::AnyLicense

pub enum AnyLicense<'a> {
    Known(License),
    Unknown(Cow<'a, str>),
}

Any license, known or otherwise.

Variants

Known(License)

A license known to Ocean.

This means information such as OSI approval and "libre"-ness can be checked.

Unknown(Cow<'a, str>)

A license unknown to Ocean. This is generally treated as an opaque ID.

Methods

impl<'a> AnyLicense<'a>[src]

pub fn owned<S>(s: S) -> Self where
    S: Into<String> + AsRef<str>, 
[src]

Creates an instance from s where any external reference in s is not kept.

pub fn id(&self) -> &str[src]

Returns the license's identifier by reference.

pub fn is_known(&self) -> bool[src]

Returns whether the license is known to Ocean.

Trait Implementations

impl<'a> Clone for AnyLicense<'a>[src]

impl<'a> Debug for AnyLicense<'a>[src]

impl<'de: 'a, 'a> Deserialize<'de> for AnyLicense<'a>[src]

impl<'_> Display for AnyLicense<'_>[src]

impl<'a> Eq for AnyLicense<'a>[src]

impl<'a> From<&'a str> for AnyLicense<'a>[src]

impl<'a> From<Cow<'a, str>> for AnyLicense<'a>[src]

impl<'_> From<License> for AnyLicense<'_>[src]

impl<'_> From<SpdxLicense> for AnyLicense<'_>[src]

impl<'_> From<String> for AnyLicense<'_>[src]

impl<'a> Hash for AnyLicense<'a>[src]

impl<'a> PartialEq<AnyLicense<'a>> for AnyLicense<'a>[src]

impl<'_> Serialize for AnyLicense<'_>[src]

impl<'a> StructuralEq for AnyLicense<'a>[src]

impl<'a> StructuralPartialEq for AnyLicense<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for AnyLicense<'a>

impl<'a> Send for AnyLicense<'a>

impl<'a> Sync for AnyLicense<'a>

impl<'a> Unpin for AnyLicense<'a>

impl<'a> UnwindSafe for AnyLicense<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.