pub enum Token<'a> {
Spdx(LicenseId),
LicenseRef {
doc_ref: Option<&'a str>,
lic_ref: &'a str,
},
Exception(ExceptionId),
AdditionRef {
doc_ref: Option<&'a str>,
add_ref: &'a str,
},
Unknown(&'a str),
Plus,
OpenParen,
CloseParen,
With,
And,
Or,
}Expand description
A single token in an SPDX license expression
Variants§
Spdx(LicenseId)
A recognized SPDX license id
LicenseRef
A LicenseRef- prefixed id, with an optional DocumentRef-
Fields
Exception(ExceptionId)
A recognized SPDX exception id
AdditionRef
A AdditionRef- prefixed id, with an optional DocumentRef-
Fields
Unknown(&'a str)
An unknown license term was encountered
Plus
A postfix + indicating “or later” for a particular SPDX license id
OpenParen
A ( for starting a group
CloseParen
A ) for ending a group
With
A WITH operator
And
An AND operator
Or
An OR operator
Trait Implementations§
impl<'a> Eq for Token<'a>
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> Freeze for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnsafeUnpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more