diff --git a/bindings/rust/evmc-declare/src/lib.rs b/bindings/rust/evmc-declare/src/lib.rs index d58de00..928fc6a 100644 --- a/bindings/rust/evmc-declare/src/lib.rs +++ b/bindings/rust/evmc-declare/src/lib.rs @@ -308,7 +308,7 @@ fn build_create_fn(names: &VMNameSet) -> proc_macro2::TokenStream { } } -/// Builds a callback to dispose of the VM instance +/// Builds a callback to dispose of the VM instance. fn build_destroy_fn(names: &VMNameSet) -> proc_macro2::TokenStream { let type_ident = names.get_type_as_ident(); @@ -321,6 +321,7 @@ fn build_destroy_fn(names: &VMNameSet) -> proc_macro2::TokenStream { } } +/// Builds the main execution entry point. fn build_execute_fn(names: &VMNameSet) -> proc_macro2::TokenStream { let type_name_ident = names.get_type_as_ident(); @@ -361,6 +362,7 @@ fn build_execute_fn(names: &VMNameSet) -> proc_macro2::TokenStream { }); let result = if result.is_err() { + // Consider a panic an internal error. ::evmc_vm::ExecutionResult::new(::evmc_vm::ffi::evmc_status_code::EVMC_INTERNAL_ERROR, 0, None) } else { result.unwrap() diff --git a/bindings/rust/evmc-vm/src/lib.rs b/bindings/rust/evmc-vm/src/lib.rs index 84f87b6..9c7ab37 100644 --- a/bindings/rust/evmc-vm/src/lib.rs +++ b/bindings/rust/evmc-vm/src/lib.rs @@ -3,6 +3,11 @@ * Licensed under the Apache License, Version 2.0. */ +//! Rust bindings for EVMC (Ethereum Client-VM Connector API). +//! +//! Have a look at evmc-declare to declare an EVMC compatible VM. +//! This crate documents how to use certain data types. + mod container; pub use container::EvmcContainer;