add Debug for SDKAst types

This commit is contained in:
vms 2021-05-10 23:26:37 +03:00
parent 859da3627b
commit 4f75d3d26e
5 changed files with 14 additions and 12 deletions

View File

@ -1,6 +1,6 @@
[package]
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"
description = "Implementation of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"

View File

@ -19,26 +19,26 @@ use crate::parsed_type::ParsedType;
use serde::Serialize;
use serde::Deserialize;
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct FnArgument {
pub name: String,
pub ty: ParsedType,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct FnSignature {
pub name: String,
pub arguments: Vec<FnArgument>,
pub output_types: Vec<ParsedType>,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct RecordType {
pub name: String,
pub fields: RecordFields,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum RecordFields {
Named(Vec<RecordField>),
// 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,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RecordField {
// fields of tuple structs haven't got name
pub name: Option<String>,
pub ty: ParsedType,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ExternFnType {
pub link_name: Option<String>,
// only imports are possible here
pub signature: FnSignature,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ExternModType {
pub namespace: String,
// only imports are possible here
pub imports: Vec<ExternFnType>,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct FnType {
pub signature: FnSignature,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(tag = "ast_type")]
pub enum SDKAst {
Function(FnType),

View File

@ -1,6 +1,6 @@
[package]
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"
description = "Definition of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"

View File

@ -27,6 +27,8 @@
#![warn(rust_2018_idioms)]
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::SecurityTetraplet;

View File

@ -1,6 +1,6 @@
[package]
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"
documentation = "https://docs.rs/fluence/"
repository = "https://github.com/fluencelabs/rust-sdk"