Skip to content

Commit 9bb739a

Browse files
authoredFeb 21, 2024
feat!: rename lambda to lens (#159)
rename lambda to lens
1 parent 53077ef commit 9bb739a

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed
 

‎crates/call-parameters/src/lib.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ pub struct SecurityTetraplet {
3838
/// Name of a function that returned corresponding value.
3939
pub function_name: String,
4040

41-
/// Value was produced by applying this `lambda` to the output from `call_service`.
42-
pub lambda: String,
41+
/// Value was produced by applying this `lens` to the output from `call_service`.
42+
pub lens: String,
4343
}
4444

4545
impl SecurityTetraplet {
4646
pub fn new(
4747
peer_pk: impl Into<String>,
4848
service_id: impl Into<String>,
4949
function_name: impl Into<String>,
50-
lambda: impl Into<String>,
50+
lens: impl Into<String>,
5151
) -> Self {
5252
Self {
5353
peer_pk: peer_pk.into(),
5454
service_id: service_id.into(),
5555
function_name: function_name.into(),
56-
lambda: lambda.into(),
56+
lens: lens.into(),
5757
}
5858
}
5959

@@ -65,13 +65,13 @@ impl SecurityTetraplet {
6565
peer_pk: init_peer_id.into(),
6666
service_id: String::new(),
6767
function_name: String::new(),
68-
// lambda can't be applied to the string literals
69-
lambda: String::new(),
68+
// lens can't be applied to the string literals
69+
lens: String::new(),
7070
}
7171
}
7272

73-
pub fn add_lambda(&mut self, lambda: &str) {
74-
self.lambda.push_str(lambda)
73+
pub fn add_lens(&mut self, lens: &str) {
74+
self.lens.push_str(lens)
7575
}
7676
}
7777

@@ -138,8 +138,8 @@ impl fmt::Display for SecurityTetraplet {
138138
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
139139
write!(
140140
f,
141-
"peer_pk: {}, service_id: {}, function_name: {}, lambda: {}",
142-
self.peer_pk, self.service_id, self.function_name, self.lambda
141+
"peer_pk: {}, service_id: {}, function_name: {}, lens: {}",
142+
self.peer_pk, self.service_id, self.function_name, self.lens
143143
)
144144
}
145145
}
@@ -162,7 +162,7 @@ pub fn get_call_parameters() -> CallParameters {
162162
}
163163

164164
#[cfg(all(feature = "marine-abi", target_arch = "wasm32"))]
165-
#[link(wasm_import_module = "__marine_host_api_v2")]
165+
#[link(wasm_import_module = "__marine_host_api_v3")]
166166
#[allow(improper_ctypes)]
167167
extern "C" {
168168
// returns serialized current call parameters

‎crates/main/src/logger.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ pub fn log_utf8_string(level: i32, target: i32, msg_ptr: i32, msg_size: i32) {
242242
/// TODO: mark `log_utf8_string_impl` as #[wasm_bindgen], so it is polyfilled by bindgen
243243
/// log_utf8_string should be provided directly by a host.
244244
#[cfg(all(feature = "marine-abi", target_arch = "wasm32"))]
245-
#[link(wasm_import_module = "__marine_host_api_v2")]
245+
#[link(wasm_import_module = "__marine_host_api_v3")]
246246
extern "C" {
247247
// Writes a byte string of size bytes that starts from ptr to a logger
248248
#[link_name = "log_utf8_string"]

‎crates/marine-macro-impl/src/parse_macro_input/item_foreign_mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syn::spanned::Spanned;
2525
const LINK_NAME_DIRECTIVE_NAME: &str = "link_name";
2626
const HOST_IMPORT_DIRECTIVE_NAME: &str = "host_import";
2727
const MODULE_IMPORT_DIRECTIVE_NAME: &str = "module_import";
28-
const HOST_IMPORT_NAMESPACE: &str = "__marine_host_api_v2";
28+
const HOST_IMPORT_NAMESPACE: &str = "__marine_host_api_v3";
2929

3030
impl ParseMacroInput for syn::ItemForeignMod {
3131
fn parse_macro_input(self) -> Result<MarineAst> {

0 commit comments

Comments
 (0)