feat!: rename lambda to lens (#159)

rename lambda to lens
This commit is contained in:
Valery Antopol 2024-02-21 14:37:44 +04:00 committed by GitHub
parent 53077ef00c
commit 9bb739a6e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 13 deletions

View File

@ -38,8 +38,8 @@ pub struct SecurityTetraplet {
/// Name of a function that returned corresponding value.
pub function_name: String,
/// Value was produced by applying this `lambda` to the output from `call_service`.
pub lambda: String,
/// Value was produced by applying this `lens` to the output from `call_service`.
pub lens: String,
}
impl SecurityTetraplet {
@ -47,13 +47,13 @@ impl SecurityTetraplet {
peer_pk: impl Into<String>,
service_id: impl Into<String>,
function_name: impl Into<String>,
lambda: impl Into<String>,
lens: impl Into<String>,
) -> Self {
Self {
peer_pk: peer_pk.into(),
service_id: service_id.into(),
function_name: function_name.into(),
lambda: lambda.into(),
lens: lens.into(),
}
}
@ -65,13 +65,13 @@ impl SecurityTetraplet {
peer_pk: init_peer_id.into(),
service_id: String::new(),
function_name: String::new(),
// lambda can't be applied to the string literals
lambda: String::new(),
// lens can't be applied to the string literals
lens: String::new(),
}
}
pub fn add_lambda(&mut self, lambda: &str) {
self.lambda.push_str(lambda)
pub fn add_lens(&mut self, lens: &str) {
self.lens.push_str(lens)
}
}
@ -138,8 +138,8 @@ impl fmt::Display for SecurityTetraplet {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"peer_pk: {}, service_id: {}, function_name: {}, lambda: {}",
self.peer_pk, self.service_id, self.function_name, self.lambda
"peer_pk: {}, service_id: {}, function_name: {}, lens: {}",
self.peer_pk, self.service_id, self.function_name, self.lens
)
}
}
@ -162,7 +162,7 @@ pub fn get_call_parameters() -> CallParameters {
}
#[cfg(all(feature = "marine-abi", target_arch = "wasm32"))]
#[link(wasm_import_module = "__marine_host_api_v2")]
#[link(wasm_import_module = "__marine_host_api_v3")]
#[allow(improper_ctypes)]
extern "C" {
// returns serialized current call parameters

View File

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

View File

@ -25,7 +25,7 @@ use syn::spanned::Spanned;
const LINK_NAME_DIRECTIVE_NAME: &str = "link_name";
const HOST_IMPORT_DIRECTIVE_NAME: &str = "host_import";
const MODULE_IMPORT_DIRECTIVE_NAME: &str = "module_import";
const HOST_IMPORT_NAMESPACE: &str = "__marine_host_api_v2";
const HOST_IMPORT_NAMESPACE: &str = "__marine_host_api_v3";
impl ParseMacroInput for syn::ItemForeignMod {
fn parse_macro_input(self) -> Result<MarineAst> {