Attributes:
- fileencrypt
- encrypt Data encryption method
- decrypt Data decryption method
- The above encryption and decryption methods must be set at the same time, otherwise encryption and decryption will not be performed.
- #[file
encrypt(encrypt="TestEncryptTool::encrypt",decrypt="TestEncryptTool::decrypt")]
dumpfilename
- Custom dump file name
- If not set ,the default dump file name is the full name of the current Struct.
- For example, the default dump file name corresponding to serde2file::test::TestData is serde2file-test-TestData.json
- #[dumpfilename = "test_data"]
属性
- fileencrypt
- encrypt 数据加密方法
- decrypt 数据解密方法
- 以上加密和解密方法必须同时设置,否则不进行加解密。
- #[file
encrypt(encrypt="TestEncryptTool::encrypt",decrypt="TestEncryptTool::decrypt")]
dumpfilename
- 设置自定义的转储文件名称
- 自定义转储文件名称
- 如未设置,默认为当前Struct的完整名称,
- 如serde2file::test::TestData对应的缺省转储文件名称为serde2file-test-TestData.json
- #[dumpfilename = "test_data.json"]
Examples/例子
```ignore
use serde2filemacroderive::FileSerializeAndDeserialize;
[allow(dead_code)]
[derive(Serialize, Deserialize, FileSerializeAndDeserialize)]
[file_encrypt(encrypt=TestEncryptTool::encrypt,decrypt=TestEncryptTool::decrypt)]
[dumpfilename = "test_data.json"]
struct TestData{
id:String,
name:String
}
```