Struct fuels_contract::logs::LogDecoder
source · pub struct LogDecoder {
pub logs_map: HashMap<(Bech32ContractId, u64), ParamType>,
}
Expand description
Struct used to pass the log mappings from the Abigen
Fields§
§logs_map: HashMap<(Bech32ContractId, u64), ParamType>
A mapping of (contract-id, log-id) and param-type
Implementations§
source§impl LogDecoder
impl LogDecoder
sourcepub fn get_logs(&self, receipts: &[Receipt]) -> Result<Vec<String>, Error>
pub fn get_logs(&self, receipts: &[Receipt]) -> Result<Vec<String>, Error>
Get all decoded logs from the given receipts as String
sourcepub fn get_logs_with_type<T: Tokenizable + Parameterize>(
&self,
receipts: &[Receipt]
) -> Result<Vec<T>, Error>
pub fn get_logs_with_type<T: Tokenizable + Parameterize>(
&self,
receipts: &[Receipt]
) -> Result<Vec<T>, Error>
Get decoded logs with specific type from the given receipts.
Note that this method returns the actual type and not a String
representation.
pub fn merge(&mut self, log_decoder: &LogDecoder)
Trait Implementations§
source§impl Clone for LogDecoder
impl Clone for LogDecoder
source§fn clone(&self) -> LogDecoder
fn clone(&self) -> LogDecoder
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 Debug for LogDecoder
impl Debug for LogDecoder
source§impl Default for LogDecoder
impl Default for LogDecoder
source§fn default() -> LogDecoder
fn default() -> LogDecoder
Returns the “default value” for a type. Read more