Open aminballoon opened 4 months ago
I want to define const struct like Python DataClasses I have 2 files 1st is datatype.rs
const struct
Python DataClasses
use derive_new::new; #[derive(new)] struct NameSpaces { #[new(value = "\"/dog\".to_string()")] dog: String, #[new(value = "\"/cat\".to_string()")] cat: String, }
2nd is main.rx
mod datatype; #[tokio::main] async fn main() { let ns = datatype::NameSpaces::new(); println!("{}", ns.dog); std::future::pending::<()>().await; }
Issue is field `dog` of `NameSpaces` is private Does it possible to change it to global ??
field `dog` of `NameSpaces` is private
I want to define
const struct
likePython DataClasses
I have 2 files 1st is datatype.rs2nd is main.rx
Issue is
field `dog` of `NameSpaces` is private
Does it possible to change it to global ??