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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 20 bytes
Size for each variant:
Root: 12 bytesTuple: 20 bytes