pub struct CallDecoder { /* private fields */ }
Expand description
Decode input data parsing input data.
Implementations§
Source§impl CallDecoder
impl CallDecoder
Sourcepub fn from_signatures<S: AsRef<str>>(signatures: &[S]) -> Result<Self>
pub fn from_signatures<S: AsRef<str>>(signatures: &[S]) -> Result<Self>
Initialize decoder from event signatures.
use hypersync_client::CallDecoder;
let decoder = CallDecoder::from_signatures(&[
"transfer(address to,uint256 amount)",
]).unwrap();
Sourcepub fn decode_input(&self, data: &Data) -> Result<Option<Vec<DynSolValue>>>
pub fn decode_input(&self, data: &Data) -> Result<Option<Vec<DynSolValue>>>
Parse input data and return result
Returns Ok(None) if signature not found.
Sourcepub fn decode_output(
&self,
data: &Data,
function_signature: &str,
) -> Result<Option<Vec<DynSolValue>>>
pub fn decode_output( &self, data: &Data, function_signature: &str, ) -> Result<Option<Vec<DynSolValue>>>
Parse output data and return result
Decodes the output field from a trace
and returns the decoded values in a Vec<DynSolValue>
. If the function
signature is not found or the decoding fails, it returns Ok(None)
as
the result to match the behavior of decode_input
Auto Trait Implementations§
impl Freeze for CallDecoder
impl RefUnwindSafe for CallDecoder
impl Send for CallDecoder
impl Sync for CallDecoder
impl Unpin for CallDecoder
impl UnwindSafe for CallDecoder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more