在Scrypto中,我的文件夹结构如下:
src/
├── lib.rs
├── script.rs
├── custom_types
│ └── type.rs在type.rs中,我定义了以下内容:
use sbor::*;
#[derive(TypeId, Encode, Decode, Describe)]
pub struct Date {
year: u8,
day: u8,
month: u8,
}我想要能够在Date中使用script.rs结构,我该怎么做呢?
发布于 2022-07-16 14:41:02
组织以下文件:
src/
├── lib.rs
├── script.rs
├── custom_types
│ └── type.rs
│ └── mod.rsmod.rs
pub mod type;将以下内容添加到script.rs
use super::custom_types::type::Date;
...最后,将以下内容添加到lib.rs中
mod datatypes;https://stackoverflow.com/questions/73005099
复制相似问题