Struct alloy_sol_type_parser::RootType
source · #[repr(transparent)]pub struct RootType<'a>(_);Expand description
A root type, with no array suffixes. Corresponds to a single, non-sequence type. This is the most basic type specifier.
Examples
let root_type = RootType::try_from("uint256")?;
assert_eq!(root_type.span(), "uint256");
// Allows unknown types
assert_eq!(
RootType::try_from("MyStruct")?.span(),
"MyStruct",
);
// No sequences
assert!(
RootType::try_from("uint256[2]").is_err()
);
// No tuples
assert!(
RootType::try_from("(uint256,uint256)").is_err()
);Implementations§
Trait Implementations§
source§impl<'a> Ord for RootType<'a>
impl<'a> Ord for RootType<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq<RootType<'a>> for RootType<'a>
impl<'a> PartialEq<RootType<'a>> for RootType<'a>
source§impl<'a> PartialOrd<RootType<'a>> for RootType<'a>
impl<'a> PartialOrd<RootType<'a>> for RootType<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<'a> Copy for RootType<'a>
impl<'a> Eq for RootType<'a>
impl<'a> StructuralEq for RootType<'a>
impl<'a> StructuralPartialEq for RootType<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for RootType<'a>
impl<'a> Send for RootType<'a>
impl<'a> Sync for RootType<'a>
impl<'a> Unpin for RootType<'a>
impl<'a> UnwindSafe for RootType<'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