Question is stated in the coding snippet as a comment in field entries assignment.
<code>
pub fn load<T: Read>(reader: &mut T) -> FileStrucure {
// Now we construct our header and return it
let fstruct = FileStrucure {
magic: Self::load_string(reader, 4),
count: BigEndian::read_i32(&Self::load_part(reader, 4)),
entries: Entry::load_entries(reader, /* How do i get count in this closure from the structure? */ 592),
};
fstruct
}
</code>
<code>
pub fn load<T: Read>(reader: &mut T) -> FileStrucure {
// Now we construct our header and return it
let fstruct = FileStrucure {
magic: Self::load_string(reader, 4),
count: BigEndian::read_i32(&Self::load_part(reader, 4)),
entries: Entry::load_entries(reader, /* How do i get count in this closure from the structure? */ 592),
};
fstruct
}
</code>
pub fn load<T: Read>(reader: &mut T) -> FileStrucure {
// Now we construct our header and return it
let fstruct = FileStrucure {
magic: Self::load_string(reader, 4),
count: BigEndian::read_i32(&Self::load_part(reader, 4)),
entries: Entry::load_entries(reader, /* How do i get count in this closure from the structure? */ 592),
};
fstruct
}
I tried to access it with self::count
and fstruct.count
but nothing works.
New contributor
RiseYx Saramoso is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.