pub struct TupleSpecifier<'a> {
pub span: &'a str,
pub types: Vec<TypeSpecifier<'a>>,
}
Expand description
A tuple specifier, with no array suffixes. Corresponds to a sequence of types.
The internal types are all TypeSpecifier
, and may be arbitrarily
complex.
§Examples
let spec = TupleSpecifier::parse("(uint256,uint256)")?;
assert_eq!(spec.span(), "(uint256,uint256)");
assert_eq!(spec.types.len(), 2);
assert_eq!(spec.types[0].span(), "uint256");
// No array suffixes. Use `TypeSpecifier` instead.
assert!(TupleSpecifier::parse("(uint256,uint256)[]").is_err());
Fields§
§span: &'a str
The full span of the tuple specifier.
types: Vec<TypeSpecifier<'a>>
The internal types.
Implementations§
Source§impl<'a> TupleSpecifier<'a>
impl<'a> TupleSpecifier<'a>
Trait Implementations§
Source§impl AsRef<str> for TupleSpecifier<'_>
impl AsRef<str> for TupleSpecifier<'_>
Source§impl<'a> Clone for TupleSpecifier<'a>
impl<'a> Clone for TupleSpecifier<'a>
Source§fn clone(&self) -> TupleSpecifier<'a>
fn clone(&self) -> TupleSpecifier<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for TupleSpecifier<'a>
impl<'a> Debug for TupleSpecifier<'a>
Source§impl<'a> PartialEq for TupleSpecifier<'a>
impl<'a> PartialEq for TupleSpecifier<'a>
Source§impl<'a> TryFrom<&'a str> for TupleSpecifier<'a>
impl<'a> TryFrom<&'a str> for TupleSpecifier<'a>
impl<'a> Eq for TupleSpecifier<'a>
impl<'a> StructuralPartialEq for TupleSpecifier<'a>
Auto Trait Implementations§
impl<'a> Freeze for TupleSpecifier<'a>
impl<'a> RefUnwindSafe for TupleSpecifier<'a>
impl<'a> Send for TupleSpecifier<'a>
impl<'a> Sync for TupleSpecifier<'a>
impl<'a> Unpin for TupleSpecifier<'a>
impl<'a> UnwindSafe for TupleSpecifier<'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
)