pub enum TypeStem<'a> {
Root(RootType<'a>),
Tuple(TupleSpecifier<'a>),
}
Expand description
A stem of a Solidity array type. It is either a root type, or a tuple type.
§Examples
let stem = TypeStem::parse("uint256")?;
assert_eq!(stem.span(), "uint256");
assert!(matches!(stem, TypeStem::Root(_)));
assert_eq!(stem.as_root(), Some(&RootType::parse("uint256").unwrap()));
let stem = TypeStem::parse("(uint256,bool)")?;
assert_eq!(stem.span(), "(uint256,bool)");
assert!(matches!(stem, TypeStem::Tuple(_)));
assert_eq!(stem.as_tuple(), Some(&TupleSpecifier::parse("(uint256,bool)").unwrap()));
Variants§
Implementations§
Trait Implementations§
impl<'a> Eq for TypeStem<'a>
impl<'a> StructuralPartialEq for TypeStem<'a>
Auto Trait Implementations§
impl<'a> Freeze for TypeStem<'a>
impl<'a> RefUnwindSafe for TypeStem<'a>
impl<'a> Send for TypeStem<'a>
impl<'a> Sync for TypeStem<'a>
impl<'a> Unpin for TypeStem<'a>
impl<'a> UnwindSafe for TypeStem<'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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)