mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2025-03-15 12:40:50 +00:00
add Debug for SDKAst types
This commit is contained in:
parent
859da3627b
commit
4f75d3d26e
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "marine-macro-impl"
|
name = "marine-macro-impl"
|
||||||
version = "0.6.2" # remember to update html_root_url
|
version = "0.6.3" # remember to update html_root_url
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Implementation of the `#[marine]` macro"
|
description = "Implementation of the `#[marine]` macro"
|
||||||
documentation = "https://docs.rs/fluence/marine-macro"
|
documentation = "https://docs.rs/fluence/marine-macro"
|
||||||
|
@ -19,26 +19,26 @@ use crate::parsed_type::ParsedType;
|
|||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct FnArgument {
|
pub struct FnArgument {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub ty: ParsedType,
|
pub ty: ParsedType,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct FnSignature {
|
pub struct FnSignature {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub arguments: Vec<FnArgument>,
|
pub arguments: Vec<FnArgument>,
|
||||||
pub output_types: Vec<ParsedType>,
|
pub output_types: Vec<ParsedType>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct RecordType {
|
pub struct RecordType {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub fields: RecordFields,
|
pub fields: RecordFields,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub enum RecordFields {
|
pub enum RecordFields {
|
||||||
Named(Vec<RecordField>),
|
Named(Vec<RecordField>),
|
||||||
// named and unnamed variants have the same inner field types because of it's easy to handle it,
|
// named and unnamed variants have the same inner field types because of it's easy to handle it,
|
||||||
@ -47,33 +47,33 @@ pub enum RecordFields {
|
|||||||
Unit,
|
Unit,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct RecordField {
|
pub struct RecordField {
|
||||||
// fields of tuple structs haven't got name
|
// fields of tuple structs haven't got name
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
pub ty: ParsedType,
|
pub ty: ParsedType,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct ExternFnType {
|
pub struct ExternFnType {
|
||||||
pub link_name: Option<String>,
|
pub link_name: Option<String>,
|
||||||
// only imports are possible here
|
// only imports are possible here
|
||||||
pub signature: FnSignature,
|
pub signature: FnSignature,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct ExternModType {
|
pub struct ExternModType {
|
||||||
pub namespace: String,
|
pub namespace: String,
|
||||||
// only imports are possible here
|
// only imports are possible here
|
||||||
pub imports: Vec<ExternFnType>,
|
pub imports: Vec<ExternFnType>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct FnType {
|
pub struct FnType {
|
||||||
pub signature: FnSignature,
|
pub signature: FnSignature,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "ast_type")]
|
#[serde(tag = "ast_type")]
|
||||||
pub enum SDKAst {
|
pub enum SDKAst {
|
||||||
Function(FnType),
|
Function(FnType),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "marine-macro"
|
name = "marine-macro"
|
||||||
version = "0.6.2" # remember to update html_root_url
|
version = "0.6.3" # remember to update html_root_url
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Definition of the `#[marine]` macro"
|
description = "Definition of the `#[marine]` macro"
|
||||||
documentation = "https://docs.rs/fluence/marine-macro"
|
documentation = "https://docs.rs/fluence/marine-macro"
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#![warn(rust_2018_idioms)]
|
#![warn(rust_2018_idioms)]
|
||||||
|
|
||||||
pub use marine_test_macro::marine_test;
|
pub use marine_test_macro::marine_test;
|
||||||
|
pub use marine_test_macro::fce_test;
|
||||||
|
|
||||||
pub use fluence_app_service::CallParameters;
|
pub use fluence_app_service::CallParameters;
|
||||||
pub use fluence_app_service::SecurityTetraplet;
|
pub use fluence_app_service::SecurityTetraplet;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fluence"
|
name = "fluence"
|
||||||
version = "0.6.3" # remember to update html_root_url
|
version = "0.6.4" # 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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user