I have the following structure definitions:
pub struct Estate {
row: i32,
col: i32,
pub row: Option<Box>,
}
pub struct Erw {
idx: i32,
size: i32,
buf: Option,
}
The member row in Estate is initialized using:
self.row = pub row: Option<Box>;
Now in another module, I would like to read data from a file into the field buf of Estate::row using:
.....
......
let mut buf_reader = BufReader::new(fileh);
I want to use buf_reader::read_to_string() function to read the data into the member buf of Estate::row
Is is possible? If yes, how do it do it? If not, what is the alternative?
Any help will be greatly appreciated.
Thanks,
Raj Mohan