pub enum Type {
Exactly(PrimitiveType),
EitherOf(Vec<PrimitiveType>),
}Expand description
Variants§
Exactly(PrimitiveType)
The type is exactly this named type.
EitherOf(Vec<PrimitiveType>)
The type is either of these named types..
Implementations§
Source§impl Type
impl Type
pub fn exactly<S: Into<PrimitiveType>>(t: S) -> Self
pub fn new_exactly<S: Into<PrimitiveType>>(t: S) -> Self
pub fn either<T: IntoIterator<Item = P>, P: Into<PrimitiveType>>( iter: T, ) -> Self
pub fn new_either<T: IntoIterator<Item = P>, P: Into<PrimitiveType>>( iter: T, ) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl From<PrimitiveType> for Type
impl From<PrimitiveType> for Type
Source§fn from(value: PrimitiveType) -> Self
fn from(value: PrimitiveType) -> Self
Converts to this type from the input type.
Source§impl From<Type> for FunctionType
impl From<Type> for FunctionType
Source§impl From<Vec<PrimitiveType>> for Type
impl From<Vec<PrimitiveType>> for Type
Source§fn from(value: Vec<PrimitiveType>) -> Self
fn from(value: Vec<PrimitiveType>) -> Self
Converts to this type from the input type.
Source§impl<P> FromIterator<P> for Typewhere
P: Into<PrimitiveType>,
impl<P> FromIterator<P> for Typewhere
P: Into<PrimitiveType>,
Source§fn from_iter<T: IntoIterator<Item = P>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = P>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl IntoIterator for Type
impl IntoIterator for Type
Source§impl Parser for Type
Available on crate feature parser only.
impl Parser for Type
Available on crate feature
parser only.Source§fn parse<'a, S: Into<Span<'a>>>(input: S) -> ParseResult<'a, Self::Item>
fn parse<'a, S: Into<Span<'a>>>(input: S) -> ParseResult<'a, Self::Item>
See parse_type.
type Item = Type
Source§fn parse_span(input: Span<'_>) -> ParseResult<'_, Self::Item>
fn parse_span(input: Span<'_>) -> ParseResult<'_, Self::Item>
Parses the
input into the specified Item type.Source§fn from_str(input: &str) -> Result<Self::Item, Err<ParseError<'_>>>
fn from_str(input: &str) -> Result<Self::Item, Err<ParseError<'_>>>
Uses the
Parser::parse method to parse the input and, if successful,
discards the unparsed remaining input.impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
Blanket Implementations§
Source§impl<V, T, O> AcceptMut<V, T, O> for Twhere
V: VisitorMut<T, O>,
impl<V, T, O> AcceptMut<V, T, O> for Twhere
V: VisitorMut<T, O>,
fn accept_mut(&self, v: &mut V) -> O
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> Pretty for Twhere
T: PrettyVisit,
impl<T> Pretty for Twhere
T: PrettyVisit,
Source§impl<T> PrettyVisit for T
impl<T> PrettyVisit for T
Source§fn to_doc(&self, r: &PrettyRenderer) -> RcDoc<'static>
fn to_doc(&self, r: &PrettyRenderer) -> RcDoc<'static>
Available on crate feature
pretty only.