Rename fluence sdk to marine-rs-sdk (#38)

This commit is contained in:
Mike Voronov 2021-06-15 10:25:58 +03:00 committed by GitHub
parent 9e383237aa
commit 7c8f65fb64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 188 additions and 190 deletions

View File

@ -20,9 +20,9 @@ jobs:
rustup component add clippy
cargo fmt --all -- --check --color always
(cd fluence; cargo build -v --target wasm32-wasi --all-features)
(cd fluence; cargo clippy -v --target wasm32-wasi)
(cd fluence-test; cargo build)
(cd sdk; cargo build -v --target wasm32-wasi --all-features)
(cd sdk; cargo clippy -v --target wasm32-wasi)
(cd sdk-test; cargo build)
(cd crates/marine-macro-impl; cargo test)
TARGET=wasm32-wasi cargo test -v --all-features

View File

@ -48,10 +48,10 @@ jobs:
- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Save fluence's crate version to env
- name: Save marine-rs-sdk's crate version to env
run: |
set -x
PKG_NAME=fluence
PKG_NAME=marine-rs-sdk
VERSION=$(cargo ws list -l | grep "$PKG_NAME"$ | head -n1 | awk '{ print $2 }')
echo "VERSION=$VERSION" | tee -a $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV
@ -67,7 +67,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Fluence Rust SDK ${{ env.VERSION }}
release_name: Marine Rust SDK ${{ env.VERSION }}
body: |
- [${{ env.VERSION }} @ crates.io](https://crates.io/crates/${{ env.PKG_NAME }}/${{ env.VERSION }})
draft: false

74
Cargo.lock generated
View File

@ -388,23 +388,12 @@ version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a92116bbed3be3afee952d62d6009f1a365bde985a1cf59fb933144308660743"
dependencies = [
"fluence-sdk-main 0.6.8",
"fluence-sdk-main",
"marine-macro 0.6.8",
"marine-timestamp-macro 0.6.8",
"serde",
]
[[package]]
name = "fluence"
version = "0.6.9"
dependencies = [
"fluence-sdk-main 0.6.9",
"marine-macro 0.6.9",
"marine-timestamp-macro 0.6.9",
"serde",
"trybuild",
]
[[package]]
name = "fluence-app-service"
version = "0.7.2"
@ -428,8 +417,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9421599c5540e50f3854a0a48702c31408ac1cfb06314fe391792daa3a9d800b"
dependencies = [
"cmd_lib",
"fluence 0.6.8",
"fluence-sdk-main 0.6.8",
"fluence",
"fluence-sdk-main",
"itertools 0.9.0",
"log",
"marine-runtime",
@ -469,17 +458,6 @@ dependencies = [
"serde",
]
[[package]]
name = "fluence-sdk-main"
version = "0.6.9"
dependencies = [
"lazy_static",
"log",
"marine-macro 0.6.9",
"serde",
"simple_logger",
]
[[package]]
name = "fluence-sdk-wit"
version = "0.6.1"
@ -494,17 +472,6 @@ dependencies = [
"uuid",
]
[[package]]
name = "fluence-test"
version = "0.1.9"
dependencies = [
"fluence-app-service",
"marine-test-macro",
"serde",
"serde_json",
"uuid",
]
[[package]]
name = "fnv"
version = "1.0.7"
@ -863,7 +830,7 @@ checksum = "003017e314cebb5c774569a4257f5eca82106cff170b124c6712f2fcd3ceefef"
dependencies = [
"anyhow",
"chrono",
"fluence-sdk-main 0.6.8",
"fluence-sdk-main",
"semver 0.11.0",
"serde",
"thiserror",
@ -871,6 +838,39 @@ dependencies = [
"wasmer-runtime-core-fl",
]
[[package]]
name = "marine-rs-sdk"
version = "0.6.9"
dependencies = [
"marine-macro 0.6.9",
"marine-rs-sdk-main",
"marine-timestamp-macro 0.6.9",
"serde",
"trybuild",
]
[[package]]
name = "marine-rs-sdk-main"
version = "0.6.9"
dependencies = [
"lazy_static",
"log",
"marine-macro 0.6.9",
"serde",
"simple_logger",
]
[[package]]
name = "marine-rs-sdk-test"
version = "0.1.9"
dependencies = [
"fluence-app-service",
"marine-test-macro",
"serde",
"serde_json",
"uuid",
]
[[package]]
name = "marine-runtime"
version = "0.5.0"

View File

@ -6,6 +6,6 @@ members = [
"crates/marine-test-macro",
"crates/marine-test-macro-impl",
"crates/timestamp-macro",
"fluence",
"fluence-test"
"sdk",
"sdk-test"
]

View File

@ -1,5 +1,5 @@
![crates.io version](https://img.shields.io/crates/v/fluence?color=green)
## Rust backend SDK
## Marine Rust SDK
This SDK intended to run backend application on the Fluence network. More information about usage and some internals could found in [docs](https://fluence-labs.readme.io/docs/rust-backend-sdk).
This SDK is intended to run backend application on the Fluence network with [Marine](https://github.com/fluencelabs/marine) runtime. More information about usage and some internals could found in [docs](https://doc.fluence.dev/docs/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk).

View File

@ -1,12 +1,12 @@
[package]
name = "fluence-sdk-main"
name = "marine-rs-sdk-main"
version = "0.6.9" # remember to update html_root_url
edition = "2018"
description = "Rust SDK for applications for the Fluence network"
documentation = "https://docs.rs/fluence-sdk-main"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/main"
description = "Contains logger, allocators and several other modules for marine-rs-sdk"
documentation = "https://docs.rs/marine-rs-sdk-main"
repository = "https://github.com/fluencelabs/marine-rs-sdk/tree/master/crates/main"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly"]
keywords = ["fluence", "marine", "sdk", "webassembly"]
categories = ["api-bindings", "wasm"]
license = "Apache-2.0"

View File

@ -19,7 +19,7 @@
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::needless_doctest_main)]
#![doc(html_root_url = "https://docs.rs/fluence-sdk-main/0.6.9")]
#![doc(html_root_url = "https://docs.rs/marine-rs-sdk-main/0.6.9")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -23,7 +23,7 @@
//! Macros from crate [`log`] are used as a logging facade.
//!
//! ```ignore
//! use fluence::logger;
//! use marine_rs_sdk::logger;
//! use log::{error, trace};
//! use simple_logger;
//!
@ -141,7 +141,7 @@ impl WasmLoggerBuilder {
/// Returns a error
///
/// ```ignore
/// # use fluence::logger;
/// # use marine_rs_sdk::logger;
/// # use log::info;
/// #
/// # fn main() {

View File

@ -20,7 +20,7 @@ pub const MANIFEST_SECTION_NAME: &str = "__fluence_wasm_module_manifest";
#[macro_export]
macro_rules! module_manifest {
($authors:expr, $version:expr, $description:expr, $repository:expr) => {
fluence::internal::build_timestamp!();
marine_rs_sdk::internal::build_timestamp!();
const __M_SDK_AUTHORS_SIZE: usize = $authors.as_bytes().len();
const __M_SDK_VERSION_SIZE: usize = $version.as_bytes().len();

View File

@ -4,9 +4,9 @@ version = "0.6.9" # remember to update html_root_url
edition = "2018"
description = "Implementation of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro-impl"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-macro-impl"
repository = "https://github.com/fluencelabs/marine-rs-sdk/tree/master/crates/marine-macro-impl"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "it", "interface-types"]
keywords = ["fluence", "marine", "sdk", "webassembly", "it", "interface-types"]
categories = ["api-bindings", "wasm"]
license = "Apache-2.0"

View File

@ -107,13 +107,13 @@ fn generate_epilog(ty: &Option<ParsedType>) -> proc_macro2::TokenStream {
Some(ParsedType::Record(..)) => {
quote! {
let result_ptr = result.__m_generated_serialize();
fluence::internal::set_result_ptr(result_ptr as _);
marine_rs_sdk::internal::set_result_ptr(result_ptr as _);
}
}
Some(ParsedType::Utf8Str(_)) | Some(ParsedType::Utf8String(_)) => {
quote! {
fluence::internal::set_result_ptr(result.as_ptr() as _);
fluence::internal::set_result_size(result.len() as _);
marine_rs_sdk::internal::set_result_ptr(result.as_ptr() as _);
marine_rs_sdk::internal::set_result_size(result.len() as _);
}
}
Some(ParsedType::Vector(ty, _)) => {
@ -126,8 +126,8 @@ fn generate_epilog(ty: &Option<ParsedType>) -> proc_macro2::TokenStream {
#vector_serializer
{
let (serialized_vec_ptr, serialized_vec_size) = #generated_serializer_ident(&result);
fluence::internal::set_result_ptr(serialized_vec_ptr as _);
fluence::internal::set_result_size(serialized_vec_size as _);
marine_rs_sdk::internal::set_result_ptr(serialized_vec_ptr as _);
marine_rs_sdk::internal::set_result_size(serialized_vec_size as _);
}
}
}
@ -153,7 +153,7 @@ fn generate_objs_savings(ingredients: &FnEpilogIngredients<'_>) -> proc_macro2::
match passing_style {
// result will be deleted by IT side
Some(PassingStyle::ByValue) => {
quote! { fluence::internal::add_object_to_release(Box::new(result)); }
quote! { marine_rs_sdk::internal::add_object_to_release(Box::new(result)); }
}
Some(PassingStyle::ByRef) | Some(PassingStyle::ByMutRef) => {
generate_args_savings(ingredients.args, ingredients.converted_args)
@ -175,7 +175,7 @@ fn generate_args_savings(
// such values will be deleted inside an export function because they are being moved
PassingStyle::ByValue => {}
_ => res.extend(quote! {
fluence::internal::add_object_to_release(Box::new(#converted_arg));
marine_rs_sdk::internal::add_object_to_release(Box::new(#converted_arg));
}),
}
}

View File

@ -51,9 +51,9 @@ impl ForeignModEpilogGlueCodeGenerator for Option<ParsedType> {
},
Some(ParsedType::Utf8String(_)) => quote! {
String::from_raw_parts(
fluence::internal::get_result_ptr() as _,
fluence::internal::get_result_size() as _,
fluence::internal::get_result_size() as _
marine_rs_sdk::internal::get_result_ptr() as _,
marine_rs_sdk::internal::get_result_size() as _,
marine_rs_sdk::internal::get_result_size() as _
)
},
Some(ParsedType::Vector(ty, _)) => {
@ -65,8 +65,8 @@ impl ForeignModEpilogGlueCodeGenerator for Option<ParsedType> {
quote! {
#vector_deserializer
#generated_der_ident(
fluence::internal::get_result_ptr() as _,
fluence::internal::get_result_size() as _,
marine_rs_sdk::internal::get_result_ptr() as _,
marine_rs_sdk::internal::get_result_size() as _,
)
}
}
@ -74,7 +74,7 @@ impl ForeignModEpilogGlueCodeGenerator for Option<ParsedType> {
let record_ident = new_ident!(record_name);
quote! {
#record_ident::__m_generated_deserialize(fluence::internal::get_result_ptr() as _)
#record_ident::__m_generated_deserialize(marine_rs_sdk::internal::get_result_ptr() as _)
}
}
_ => panic!(

View File

@ -1,19 +1,18 @@
/*
* copyright 2020 fluence labs limited
* Copyright 2021 Fluence Labs Limited
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/license-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* unless required by applicable law or agreed to in writing, software
* distributed under the license is distributed on an "as is" basis,
* without warranties or conditions of any kind, either express or implied.
* see the license for the specific language governing permissions and
* limitations under the license.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
use super::ParsedType;
use super::PassingStyle;

View File

@ -34,7 +34,7 @@ pub(crate) fn generate_vector_ser(
let ptr = converted_bool_vector.as_ptr();
let len = converted_bool_vector.len();
fluence::internal::add_object_to_release(Box::new(converted_bool_vector));
marine_rs_sdk::internal::add_object_to_release(Box::new(converted_bool_vector));
(ptr as _, len as _)
}

View File

@ -29,7 +29,7 @@ pub(super) fn string_ser() -> proc_macro2::TokenStream {
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
@ -54,7 +54,7 @@ pub(super) fn vector_ser(arg_name: &str, ty: &ParsedType) -> proc_macro2::TokenS
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
@ -70,7 +70,7 @@ pub(super) fn record_ser() -> proc_macro2::TokenStream {
let result_ptr = result.as_ptr();
let result_len = result.len();
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}

View File

@ -82,7 +82,7 @@ fn generate_serializer_fn(record: &AstRecord) -> proc_macro2::TokenStream {
#serializer
let raw_record_ptr = raw_record.as_ptr();
fluence::internal::add_object_to_release(Box::new(raw_record));
marine_rs_sdk::internal::add_object_to_release(Box::new(raw_record));
raw_record_ptr as _
}

View File

@ -84,7 +84,7 @@ pub unsafe fn __m_generated_wrapper_func_inner_arrays_1(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -95,7 +95,7 @@ pub unsafe fn __m_generated_wrapper_func_inner_arrays_1(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -106,15 +106,15 @@ pub unsafe fn __m_generated_wrapper_func_inner_arrays_1(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
{
let (serialized_vec_ptr, serialized_vec_size) = __m_generated_vec_serializer(&result);
fluence::internal::set_result_ptr(serialized_vec_ptr as _);
fluence::internal::set_result_size(serialized_vec_size as _);
marine_rs_sdk::internal::set_result_ptr(serialized_vec_ptr as _);
marine_rs_sdk::internal::set_result_size(serialized_vec_size as _);
}
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
}
#[cfg(target_arch = "wasm32")]
#[doc(hidden)]

View File

@ -69,10 +69,10 @@ pub unsafe fn __m_generated_wrapper_func_all_types(
}
{
let (serialized_vec_ptr, serialized_vec_size) = __m_generated_vec_serializer(&result);
fluence::internal::set_result_ptr(serialized_vec_ptr as _);
fluence::internal::set_result_size(serialized_vec_size as _);
marine_rs_sdk::internal::set_result_ptr(serialized_vec_ptr as _);
marine_rs_sdk::internal::set_result_size(serialized_vec_size as _);
}
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
}
#[cfg(target_arch = "wasm32")]
#[doc(hidden)]

View File

@ -51,7 +51,7 @@ pub unsafe fn __m_generated_wrapper_func_test_array_refs(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -63,7 +63,7 @@ pub unsafe fn __m_generated_wrapper_func_test_array_refs(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -75,7 +75,7 @@ pub unsafe fn __m_generated_wrapper_func_test_array_refs(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -86,15 +86,15 @@ pub unsafe fn __m_generated_wrapper_func_test_array_refs(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
{
let (serialized_vec_ptr, serialized_vec_size) = __m_generated_vec_serializer(&result);
fluence::internal::set_result_ptr(serialized_vec_ptr as _);
fluence::internal::set_result_size(serialized_vec_size as _);
marine_rs_sdk::internal::set_result_ptr(serialized_vec_ptr as _);
marine_rs_sdk::internal::set_result_size(serialized_vec_size as _);
}
fluence::internal::add_object_to_release(Box::new(converted_arg_0));
marine_rs_sdk::internal::add_object_to_release(Box::new(converted_arg_0));
}
#[cfg(target_arch = "wasm32")]
#[doc(hidden)]

View File

@ -45,7 +45,7 @@ impl CallParameters {
}
let result_ptr = result.as_ptr();
let result_len = result.len();
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -57,7 +57,7 @@ impl CallParameters {
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let serialized_arg_5 =
@ -65,7 +65,7 @@ impl CallParameters {
raw_record.extend(&serialized_arg_5.0.to_le_bytes());
raw_record.extend(&serialized_arg_5.1.to_le_bytes());
let raw_record_ptr = raw_record.as_ptr();
fluence::internal::add_object_to_release(Box::new(raw_record));
marine_rs_sdk::internal::add_object_to_release(Box::new(raw_record));
raw_record_ptr as _
}
pub unsafe fn __m_generated_deserialize(record_ptr: *const u8) -> Self {

View File

@ -88,7 +88,7 @@ pub unsafe fn __m_generated_wrapper_func_inner_arrays_2(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len();
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -99,7 +99,7 @@ pub unsafe fn __m_generated_wrapper_func_inner_arrays_2(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -111,7 +111,7 @@ pub unsafe fn __m_generated_wrapper_func_inner_arrays_2(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
let mut result: Vec<u32> = Vec::with_capacity(2 * arg.len());
@ -122,15 +122,15 @@ pub unsafe fn __m_generated_wrapper_func_inner_arrays_2(arg_0: u32, arg_1: u32)
}
let result_ptr = result.as_ptr();
let result_len = result.len() / 2;
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
(result_ptr as _, result_len as _)
}
{
let (serialized_vec_ptr, serialized_vec_size) = __m_generated_vec_serializer(&result);
fluence::internal::set_result_ptr(serialized_vec_ptr as _);
fluence::internal::set_result_size(serialized_vec_size as _);
marine_rs_sdk::internal::set_result_ptr(serialized_vec_ptr as _);
marine_rs_sdk::internal::set_result_size(serialized_vec_size as _);
}
fluence::internal::add_object_to_release(Box::new(result));
marine_rs_sdk::internal::add_object_to_release(Box::new(result));
}
#[cfg(target_arch = "wasm32")]
#[doc(hidden)]

View File

@ -4,9 +4,9 @@ version = "0.6.9" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-macro"
repository = "https://github.com/fluencelabs/marine-rs-sdk/tree/master/crates/marine-macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
keywords = ["fluence", "marine", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm"]
license = "Apache-2.0"

View File

@ -34,7 +34,7 @@
//! and how a struct could be passed:
//!
//! ```ignore
//! use fluence::MountedBinaryResult;
//! use marine_rs_sdk::MountedBinaryResult;
//!
//! #[marine]
//! pub fn read_ipfs_file(file_path: String) -> MountedBinaryResult {

View File

@ -4,9 +4,9 @@ version = "0.1.9" # remember to update html_root_url
edition = "2018"
description = "Implementation of the `#[marine_test]` macro"
documentation = "https://docs.rs/fluence/marine-test-macro-impl"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-test-macro-impl"
repository = "https://github.com/fluencelabs/marine-rs-sdk/tree/master/crates/marine-test-macro-impl"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
keywords = ["fluence", "marine", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm", "development-tools::testing"]
license = "Apache-2.0"

View File

@ -45,24 +45,24 @@ use std::path::PathBuf;
/// // (0)
/// pub mod __m_generated_greeting {
/// struct MGeneratedStructgreeting {
/// marine: std::rc::Rc<std::cell::RefCell<fluence_test::internal::AppService>>,
/// marine: std::rc::Rc<std::cell::RefCell<marine_rs_sdk_test::internal::AppService>>,
/// }
///
/// impl MGeneratedStructgreeting {
/// pub fn new(marine: std::rc::Rc<std::cell::RefCell<fluence_test::internal::AppService>>) -> Self {
/// pub fn new(marine: std::rc::Rc<std::cell::RefCell<marine_rs_sdk_test::internal::AppService>>) -> Self {
/// Self { marine }
/// }
///
/// pub fn greeting(&mut self, name: String) -> String {
/// use std::ops::DerefMut;
/// let arguments = fluence_test::internal::serde_json::json!([name]);
/// let arguments = marine_rs_sdk_test::internal::serde_json::json!([name]);
/// let result = self
/// .marine
/// .as_ref
/// .borrow_mut()
/// .call_with_module_name("greeting", "greeting", arguments, <_>::default())
/// .expect("call to Marine failed");
/// let result: String = fluence_test::internal::serde_json::from_value(result)
/// let result: String = marine_rs_sdk_test::internal::serde_json::from_value(result)
/// .expect("the default deserializer shouldn't fail");
/// result
/// }
@ -70,13 +70,13 @@ use std::path::PathBuf;
///}
/// // (1)
/// let tmp_dir = std::env::temp_dir();
/// let service_id = fluence_test::internal::Uuid::new_v4().to_string();
/// let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
///
/// let tmp_dir = tmp_dir.join(&service_id);
/// let tmp_dir = tmp_dir.to_string_lossy().to_string();
/// std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp");
///
/// let mut __m_generated_marine_config = fluence_test::internal::TomlAppServiceConfig::load("/path/to/greeting/Config.toml".to_string())
/// let mut __m_generated_marine_config = marine_rs_sdk_test::internal::TomlAppServiceConfig::load("/path/to/greeting/Config.toml".to_string())
/// .unwrap_or_else(|e| {
/// panic!(
/// "app service located at `{}` config can't be loaded: {}",
@ -86,7 +86,7 @@ use std::path::PathBuf;
///
/// __m_generated_marine_config.service_base_dir = Some("/path/to/tmp".to_string());
///
/// let marine = fluence_test::internal::AppService::new_with_empty_facade(
/// let marine = marine_rs_sdk_test::internal::AppService::new_with_empty_facade(
/// __m_generated_marine_config,
/// "3640e972-92e3-47cb-b95f-4e3c5bcf0f14",
/// std::collections::HashMap::new(),
@ -165,7 +165,7 @@ fn generate_app_service_ctor(config_path: &str, modules_dir: &Path) -> TResult<T
let service_ctor = quote! {
let tmp_dir = std::env::temp_dir();
let service_id = fluence_test::internal::Uuid::new_v4().to_string();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
@ -204,12 +204,12 @@ fn generate_app_service_ctor(config_path: &str, modules_dir: &Path) -> TResult<T
let modules_dir = module_path.join(#modules_dir);
let modules_dir = modules_dir.to_str().expect("modules_dir contains invalid UTF8 string");
let mut __m_generated_marine_config = fluence_test::internal::TomlAppServiceConfig::load(&config_path)
let mut __m_generated_marine_config = marine_rs_sdk_test::internal::TomlAppServiceConfig::load(&config_path)
.unwrap_or_else(|e| panic!("app service config located at `{:?}` can't be loaded: {}", config_path, e));
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_faas_config.modules_dir = Some(modules_dir.to_string());
let marine = fluence_test::internal::AppService::new_with_empty_facade(__m_generated_marine_config, service_id, std::collections::HashMap::new())
let marine = marine_rs_sdk_test::internal::AppService::new_with_empty_facade(__m_generated_marine_config, service_id, std::collections::HashMap::new())
.unwrap_or_else(|e| panic!("app service can't be created: {}", e));
let marine = std::rc::Rc::new(std::cell::RefCell::new(marine));

View File

@ -30,24 +30,24 @@ use quote::quote;
///```ignore
/// pub mod __m_generated_greeting {
/// struct MGeneratedStructgreeting {
/// marine: std::rc::Rc<std::cell::RefCell<fluence_test::internal::AppService>>,
/// marine: std::rc::Rc<std::cell::RefCell<marine_rs_sdk_test::internal::AppService>>,
/// }
///
/// impl MGeneratedStructgreeting {
/// pub fn new(marine: std::rc::Rc<std::cell::RefCell<fluence_test::internal::AppService>>) -> Self {
/// pub fn new(marine: std::rc::Rc<std::cell::RefCell<marine_rs_sdk_test::internal::AppService>>) -> Self {
/// Self { marine }
/// }
///
/// pub fn greeting(&mut self, name: String) -> String {
/// use std::ops::DerefMut;
/// let arguments = fluence_test::internal::serde_json::json!([name]);
/// let arguments = marine_rs_sdk_test::internal::serde_json::json!([name]);
/// let result = self
/// .marine
/// .as_ref
/// .borrow_mut()
/// .call_with_module_name("greeting", "greeting", arguments, <_>::default())
/// .expect("call to Marine failed");
/// let result: String = fluence_test::internal::serde_json::from_value(result)
/// let result: String = marine_rs_sdk_test::internal::serde_json::from_value(result)
/// .expect("the default deserializer shouldn't fail");
/// result
/// }
@ -87,11 +87,11 @@ fn generate_module_definition(module: &Module<'_>) -> TResult<TokenStream> {
#(#module_records)*
pub struct #struct_ident {
marine: std::rc::Rc<std::cell::RefCell<fluence_test::internal::AppService>>,
marine: std::rc::Rc<std::cell::RefCell<marine_rs_sdk_test::internal::AppService>>,
}
impl #struct_ident {
pub fn new(marine: std::rc::Rc<std::cell::RefCell<fluence_test::internal::AppService>>) -> Self {
pub fn new(marine: std::rc::Rc<std::cell::RefCell<marine_rs_sdk_test::internal::AppService>>) -> Self {
Self { marine }
}
}

View File

@ -54,7 +54,7 @@ pub(super) fn generate_module_method(
quote! { , }
};
let cp = quote! { #maybe_comma cp: fluence_test::CallParameters };
let cp = quote! { #maybe_comma cp: marine_rs_sdk_test::CallParameters };
let func_name = format!("{}_cp", signature.name);
let func_name = new_ident(&func_name)?;
(cp, func_name)
@ -106,8 +106,7 @@ fn generate_arguments_converter<'a>(
) -> TResult<TokenStream> {
let arg_idents: Vec<syn::Ident> = args.map(new_ident).collect::<Result<_, _>>()?;
let args_converter =
quote! { let arguments = fluence_test::internal::serde_json::json!([#(#arg_idents),*]); };
let args_converter = quote! { let arguments = marine_rs_sdk_test::internal::serde_json::json!([#(#arg_idents),*]); };
Ok(args_converter)
}
@ -140,7 +139,7 @@ fn generate_convert_to_output(
Some(ty) => {
let ty = itype_to_tokens(ty, records)?;
quote! {
let result: #ty = fluence_test::internal::serde_json::from_value(result).expect("the default deserializer shouldn't fail");
let result: #ty = marine_rs_sdk_test::internal::serde_json::from_value(result).expect("the default deserializer shouldn't fail");
}
}
None => TokenStream::new(),

View File

@ -31,8 +31,8 @@ pub(super) fn generate_records(records: &MRecordTypes) -> TResult<Vec<TokenStrea
let fields = prepare_field(record.fields.deref().iter(), records)?;
let generated_record = quote! {
#[derive(Clone, Debug, fluence_test::internal::serde::Serialize, fluence_test::internal::serde::Deserialize)]
#[serde(crate = "fluence_test::internal::serde")]
#[derive(Clone, Debug, marine_rs_sdk_test::internal::serde::Serialize, marine_rs_sdk_test::internal::serde::Deserialize)]
#[serde(crate = "marine_rs_sdk_test::internal::serde")]
pub struct #record_name_ident {
#(pub #fields),*
}

View File

@ -4,9 +4,9 @@ version = "0.1.9" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[marine_test]` macro"
documentation = "https://docs.rs/fluence/marine-test-macro"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-test-macro"
repository = "https://github.com/fluencelabs/marine-rs-sdk/tree/master/crates/marine-test-macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
keywords = ["fluence", "marine", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm", "development-tools::testing"]
license = "Apache-2.0"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
#![doc(html_root_url = "https://docs.rs/fluence-test-macro/0.1.8")]
#![doc(html_root_url = "https://docs.rs/sdk-test-macro/0.1.8")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -4,9 +4,9 @@ version = "0.6.9" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[build_timestamp]` macro"
documentation = "https://docs.rs/fluence/marine-timestamp-macro"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-timestamp-macro"
repository = "https://github.com/fluencelabs/marine-rs-sdk/tree/master/crates/marine-timestamp-macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
keywords = ["fluence", "marine", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm"]
license = "Apache-2.0"

View File

@ -1,11 +1,11 @@
[package]
name = "fluence-test"
name = "marine-rs-sdk-test"
version = "0.1.9" # remember to update html_root_url
description = "Fluence backend SDK for testing"
documentation = "https://docs.rs/fluence-test"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/fluence-test"
description = "Backend SDK that allows testing modules for the Marine runtime"
documentation = "https://docs.rs/marine-rs-sdk-test"
repository = "https://github.com/fluencelabs/marine-rs-sdk/tree/master/fluence-test"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "test"]
keywords = ["fluence", "marine", "sdk", "webassembly", "test"]
categories = ["api-bindings", "wasm", "development-tools::testing"]
license = "Apache-2.0"
edition = "2018"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
#![doc(html_root_url = "https://docs.rs/fluence-test/0.1.8")]
#![doc(html_root_url = "https://docs.rs/sdk-test/0.1.8")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -1,11 +1,11 @@
[package]
name = "fluence"
name = "marine-rs-sdk"
version = "0.6.9" # remember to update html_root_url
description = "Fluence backend SDK for developing backend applications for the Fluence network"
documentation = "https://docs.rs/fluence"
repository = "https://github.com/fluencelabs/rust-sdk"
repository = "https://github.com/fluencelabs/marine-rs-sdk"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly"]
keywords = ["fluence", "marine", "sdk", "webassembly"]
categories = ["api-bindings", "wasm"]
license = "Apache-2.0"
edition = "2018"
@ -19,7 +19,7 @@ doctest = false
[dependencies]
marine-macro = { path = "../crates/marine-macro", version = "=0.6.9" }
fluence-sdk-main = { path = "../crates/main", version = "=0.6.9" }
marine-rs-sdk-main = { path = "../crates/main", version = "=0.6.9" }
marine-timestamp-macro = { path = "../crates/timestamp-macro", version = "=0.6.9" }
serde = { version = "1.0.118", features = ["derive"]}
@ -29,7 +29,7 @@ trybuild = "1.0"
[features]
# Print some internal logs by log_utf8_string
debug = ["fluence-sdk-main/debug"]
debug = ["marine-rs-sdk-main/debug"]
# Enable logger (this will cause log_utf8_string to appear in imports)
logger = ["fluence-sdk-main/logger"]
logger = ["marine-rs-sdk-main/logger"]

View File

@ -22,7 +22,7 @@
//! following primitive Rust types
//! (`bool, u8, u16, u32, u64, i8, i16, i32, i64, f32, f64, String, Vec<u8>`).
//! ```rust
//! use fluence::marine;
//! use marine_rs_sdk::marine;
//!
//! #[marine]
//! struct T {
@ -34,7 +34,7 @@
//! Functions with `#[marine]` will be exported from this module:
//!
//! ```rust
//! use fluence::marine;
//! use marine_rs_sdk::marine;
//!
//! #[marine]
//! pub fn get(url: String) {
@ -46,7 +46,7 @@
//!
//! Finally, to import other wasm modules to your project use similar code:
//! ```rust
//! use fluence::marine;
//! use marine_rs_sdk::marine;
//!
//! #[marine]
//! #[link(wasm_import_module = "wasm_curl.wasm")]
@ -55,7 +55,7 @@
//! pub fn curl_get(url: String) -> String;
//! }
//! ```
#![doc(html_root_url = "https://docs.rs/fluence/0.6.9")]
#![doc(html_root_url = "https://docs.rs/sdk/0.6.9")]
#![deny(
dead_code,
nonstandard_style,
@ -71,8 +71,8 @@ mod call_parameters;
mod mounted_binary;
#[allow(unused_extern_crates)]
// fluence is used inside CallParameters and MountedBinaryResult glue code
extern crate self as fluence;
// sdk is used inside CallParameters and MountedBinaryResult glue code
extern crate self as marine_rs_sdk;
pub use marine_macro::marine;
pub use marine_macro::fce;
@ -82,23 +82,23 @@ pub use call_parameters::SecurityTetraplet;
pub use call_parameters::get_call_parameters;
#[cfg(feature = "logger")]
pub use fluence_sdk_main::WasmLoggerBuilder;
pub use marine_rs_sdk_main::WasmLoggerBuilder;
#[cfg(feature = "logger")]
pub use fluence_sdk_main::TargetMap;
pub use marine_rs_sdk_main::TargetMap;
pub use mounted_binary::MountedBinaryResult;
pub use mounted_binary::MountedBinaryStringResult;
pub use mounted_binary::SUCCESS_CODE as BINARY_SUCCESS_CODE;
pub use fluence_sdk_main::module_manifest;
pub use marine_rs_sdk_main::module_manifest;
/// These API functions are intended for internal usage in generated code.
/// Normally, you shouldn't use them.
pub mod internal {
pub use fluence_sdk_main::get_result_ptr;
pub use fluence_sdk_main::get_result_size;
pub use fluence_sdk_main::set_result_ptr;
pub use fluence_sdk_main::set_result_size;
pub use fluence_sdk_main::add_object_to_release;
pub use marine_rs_sdk_main::get_result_ptr;
pub use marine_rs_sdk_main::get_result_size;
pub use marine_rs_sdk_main::set_result_ptr;
pub use marine_rs_sdk_main::set_result_size;
pub use marine_rs_sdk_main::add_object_to_release;
pub use marine_timestamp_macro::build_timestamp;
}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
pub fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
fn main() {}

View File

@ -1,4 +1,4 @@
use fluence::marine;
use marine_rs_sdk::marine;
fn main() {}

View File

@ -1,4 +1,4 @@
use fluence::marine;
use marine_rs_sdk::marine;
fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
fn main() {}

View File

@ -1,6 +1,6 @@
#![allow(improper_ctypes)]
use fluence::marine;
use marine_rs_sdk::marine;
fn main() {}