pub enum License {
Single(Box<Expression>),
AnyOf(Vec<Expression>),
}Expand description
License field value.
This may either be a single SPDX license expression, or a list of licenses or expressions.
A list should be interpreted as being a single expression with members
joined with OR; this library does no such interpretation immediately, so
as to keep the format of the original document. However, the
License::to_expression method does this for convenience.
Note that Hash, PartialEq, and Eq are implemented in term of the
original strings for the expression. That is, the list of Apache-2.0 and
MIT may not be equal or hash to the same as Apache-2.0 OR MIT.
Variants§
Single(Box<Expression>)
A single SPDX license expression.
AnyOf(Vec<Expression>)
A set of SPDX license expressions (interpreted as joined by OR).
Implementations§
Source§impl License
impl License
Sourcepub fn to_expression(&self) -> Expression
pub fn to_expression(&self) -> Expression
Get a single SPDX expression for this License value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for License
impl<'de> Deserialize<'de> for License
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for License
Auto Trait Implementations§
impl Freeze for License
impl RefUnwindSafe for License
impl Send for License
impl Sync for License
impl Unpin for License
impl UnwindSafe for License
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.