pub struct TupleSpecifier<'a> {
pub span: &'a str,
pub types: Vec<TypeSpecifier<'a>>,
}Available on crate feature
json-abi only.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 strThe full span of the tuple specifier.
types: Vec<TypeSpecifier<'a>>The internal types.
Implementations§
Source§impl<'a> TupleSpecifier<'a>
impl<'a> TupleSpecifier<'a>
Sourcepub fn parse(input: &'a str) -> Result<TupleSpecifier<'a>, Error>
Available on crate feature dyn-abi only.
pub fn parse(input: &'a str) -> Result<TupleSpecifier<'a>, Error>
dyn-abi only.Parse a tuple specifier from a string.
Sourcepub const fn span(&self) -> &'a str
Available on crate feature dyn-abi only.
pub const fn span(&self) -> &'a str
dyn-abi only.Returns the tuple specifier as a string.
Sourcepub fn try_basic_solidity(&self) -> Result<(), Error>
Available on crate feature dyn-abi only.
pub fn try_basic_solidity(&self) -> Result<(), Error>
dyn-abi only.Returns true if the type is a basic Solidity type.
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 Specifier<DynSolType> for TupleSpecifier<'_>
impl Specifier<DynSolType> for TupleSpecifier<'_>
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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: 40 bytes