-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5d6b30
commit 95b36c5
Showing
10 changed files
with
138 additions
and
129 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,37 @@ | ||
pub mod error; | ||
pub mod udf; | ||
pub mod utils; | ||
use std::fmt; | ||
|
||
use wasmtime::*; | ||
|
||
#[derive(Clone)] | ||
pub struct WasmSession { | ||
/// Used just for printing errors | ||
pub module_path: String, | ||
pub function_name: String, | ||
pub instance_pre: InstancePre<()>, | ||
pub engine: Engine, | ||
pub value_types: Vec<ValType>, | ||
pub return_type: ValType, | ||
} | ||
|
||
/// Debug implementation for WasmSession. | ||
/// `instance_pre` is omitted from this implementation. | ||
impl fmt::Debug for WasmSession { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
f.debug_struct("WasmSession") | ||
.field("module_path", &self.function_name) | ||
.field("function_name", &self.function_name) | ||
// Omit the debug values for `InstancePre` and `Engine` | ||
.field("value_types", &self.value_types) | ||
.field("return_type", &self.return_type) | ||
.finish() | ||
} | ||
} | ||
|
||
impl PartialEq for WasmSession { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.value_types == other.value_types && self.return_type == other.return_type | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters