I have a module where a tuple struct is defined as:
#[derive(Clone, Default, Eq, Hash, PartialEq, PartialOrd)]
pub struct Id(Vec<u8>);
I make use of this struct in another module which needs to be imported there. But when I try to instantiate this struct Id as:
let mut id = Id(newId.as_bytes().to_vec()); //newId is a String
it throws an error saying:
constructor is not visible here due to private fields
How do I make the unnamed field public (though I cannot in my case as this is part of an API)? Or is there a different way to initialize this struct ?