mirror of
https://github.com/fluencelabs/marine-rs-sdk
synced 2025-03-15 22:30:50 +00:00
Merge pull request #15 from fluencelabs/call_parameters_v3
Update CallParameters
This commit is contained in:
commit
71591f412c
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fluence"
|
name = "fluence"
|
||||||
version = "0.2.12" # remember to update html_root_url
|
version = "0.2.13" # remember to update html_root_url
|
||||||
description = "Fluence backend SDK for developing backend applications for the Fluence network"
|
description = "Fluence backend SDK for developing backend applications for the Fluence network"
|
||||||
documentation = "https://docs.rs/fluence/"
|
documentation = "https://docs.rs/fluence/"
|
||||||
repository = "https://github.com/fluencelabs/rust-sdk"
|
repository = "https://github.com/fluencelabs/rust-sdk"
|
||||||
@ -18,8 +18,8 @@ all-features = true
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fluence-sdk-macro = { path = "crates/macro", version = "=0.2.12" }
|
fluence-sdk-macro = { path = "crates/macro", version = "=0.2.13" }
|
||||||
fluence-sdk-main = { path = "crates/main", version = "=0.2.12" }
|
fluence-sdk-main = { path = "crates/main", version = "=0.2.13" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# Print some internal logs by log_utf8_string
|
# Print some internal logs by log_utf8_string
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fluence-sdk-macro"
|
name = "fluence-sdk-macro"
|
||||||
version = "0.2.12" # remember to update html_root_url
|
version = "0.2.13" # remember to update html_root_url
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Definition of `#[invoke_handler]` attribute"
|
description = "Definition of `#[invoke_handler]` attribute"
|
||||||
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
|
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
|
||||||
@ -17,4 +17,4 @@ all-features = true
|
|||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fluence-sdk-wit = { path = "../wit", version = "=0.2.12" }
|
fluence-sdk-wit = { path = "../wit", version = "=0.2.13" }
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/fluence-sdk-macro/0.2.12")]
|
#![doc(html_root_url = "https://docs.rs/fluence-sdk-macro/0.2.13")]
|
||||||
#![deny(
|
#![deny(
|
||||||
dead_code,
|
dead_code,
|
||||||
nonstandard_style,
|
nonstandard_style,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fluence-sdk-main"
|
name = "fluence-sdk-main"
|
||||||
version = "0.2.12" # remember to update html_root_url
|
version = "0.2.13" # remember to update html_root_url
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Rust SDK for applications for the Fluence network"
|
description = "Rust SDK for applications for the Fluence network"
|
||||||
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
|
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
|
||||||
@ -18,7 +18,7 @@ path = "src/lib.rs"
|
|||||||
crate-type = ["rlib"]
|
crate-type = ["rlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fluence-sdk-macro = { path = "../macro", version = "=0.2.12" }
|
fluence-sdk-macro = { path = "../macro", version = "=0.2.13" }
|
||||||
|
|
||||||
log = { version = "0.4.8", features = ["std"] }
|
log = { version = "0.4.8", features = ["std"] }
|
||||||
serde = "=1.0.118"
|
serde = "=1.0.118"
|
||||||
|
@ -33,31 +33,23 @@ pub struct SecurityTetraplet {
|
|||||||
#[fce]
|
#[fce]
|
||||||
#[derive(Clone, PartialEq, Default, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Default, Eq, Debug, Serialize, Deserialize)]
|
||||||
pub struct CallParameters {
|
pub struct CallParameters {
|
||||||
pub call_id: String,
|
/// Peer id of the AIR script initiator.
|
||||||
pub user_name: String,
|
pub init_peer_id: String,
|
||||||
pub application_id: String,
|
|
||||||
pub tetraplets: Vec<Vec<SecurityTetraplet>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl CallParameters {
|
/// Id of the current service.
|
||||||
pub fn new<C, U, A>(
|
pub service_id: String,
|
||||||
call_id: C,
|
|
||||||
user_name: U,
|
/// Id of the service creator.
|
||||||
application_id: A,
|
pub service_creator_peer_id: String,
|
||||||
tetraplets: Vec<Vec<SecurityTetraplet>>,
|
|
||||||
) -> Self
|
/// Id of the host which run this service.
|
||||||
where
|
pub host_id: String,
|
||||||
C: Into<String>,
|
|
||||||
U: Into<String>,
|
/// Id of the particle which execution resulted a call this service.
|
||||||
A: Into<String>,
|
pub particle_id: String,
|
||||||
{
|
|
||||||
Self {
|
/// Security tetraplets which described origin of the arguments.
|
||||||
call_id: call_id.into(),
|
pub tetraplets: Vec<Vec<SecurityTetraplet>>,
|
||||||
user_name: user_name.into(),
|
|
||||||
application_id: application_id.into(),
|
|
||||||
tetraplets,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This functions takes from host current call parameters.
|
/// This functions takes from host current call parameters.
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#![allow(clippy::missing_safety_doc)]
|
#![allow(clippy::missing_safety_doc)]
|
||||||
#![allow(clippy::needless_doctest_main)]
|
#![allow(clippy::needless_doctest_main)]
|
||||||
#![doc(html_root_url = "https://docs.rs/fluence-sdk-main/0.2.12")]
|
#![doc(html_root_url = "https://docs.rs/fluence-sdk-main/0.2.13")]
|
||||||
#![deny(
|
#![deny(
|
||||||
dead_code,
|
dead_code,
|
||||||
nonstandard_style,
|
nonstandard_style,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fluence-sdk-wit"
|
name = "fluence-sdk-wit"
|
||||||
version = "0.2.12" # remember to update html_root_url
|
version = "0.2.13" # remember to update html_root_url
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Webassembly interface-types generator"
|
description = "Webassembly interface-types generator"
|
||||||
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
|
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/wit-support/0.2.12")]
|
#![doc(html_root_url = "https://docs.rs/wit-support/0.2.13")]
|
||||||
#![deny(
|
#![deny(
|
||||||
dead_code,
|
dead_code,
|
||||||
nonstandard_style,
|
nonstandard_style,
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
//! pub fn curl_get(url: String) -> String;
|
//! pub fn curl_get(url: String) -> String;
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
#![doc(html_root_url = "https://docs.rs/fluence/0.2.12")]
|
#![doc(html_root_url = "https://docs.rs/fluence/0.2.13")]
|
||||||
#![deny(
|
#![deny(
|
||||||
dead_code,
|
dead_code,
|
||||||
nonstandard_style,
|
nonstandard_style,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user