pub enum TypeSpec {
Tuple(Vec<Loc<TypeExpression>>),
Array {
inner: Box<Loc<TypeExpression>>,
size: Box<Loc<TypeExpression>>,
},
Named(Loc<Path>, Option<Loc<Vec<Loc<TypeExpression>>>>),
Inverted(Box<Loc<TypeExpression>>),
Wire(Box<Loc<TypeExpression>>),
Wildcard,
}Expand description
A specification of a type to be used. For example, the types of input/output arguments the type of fields in a struct etc.
Variants§
Tuple(Vec<Loc<TypeExpression>>)
Array
Named(Loc<Path>, Option<Loc<Vec<Loc<TypeExpression>>>>)
Inverted(Box<Loc<TypeExpression>>)
An inverted signal (~), its “direction” is the inverse of normal. A ~&T taken as an
argument is an output, and a returned ~&T is an input. This used to be expressed as &mut T Inversions cancel each other, i.e. ~~&T is effectively &T Inverted signals are
ports.
If applied to a struct port, all fields are inverted.
Wire(Box<Loc<TypeExpression>>)
Wildcard
Trait Implementations§
impl StructuralPartialEq for TypeSpec
Auto Trait Implementations§
impl Freeze for TypeSpec
impl RefUnwindSafe for TypeSpec
impl Send for TypeSpec
impl Sync for TypeSpec
impl Unpin for TypeSpec
impl UnwindSafe for TypeSpec
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