pub trait ReadSite {
type Site;
// Required methods
fn read_site(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>;
fn read_site_unnormalised(
&mut self,
buf: &mut Self::Site,
) -> Result<ReadStatus>;
// Provided methods
fn enumerate(self) -> Enumerate<Self>
where Self: Sized { ... }
fn take(self, max_sites: usize) -> Take<Enumerate<Self>>
where Self: Sized { ... }
}
Expand description
A type that can read SAF sites from a source.
Required Associated Types§
Required Methods§
Sourcefn read_site(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
fn read_site(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
Reads a single site into the provided buffer.
In the multi-dimensional case, values should be read from the first population into the
start of the buffer, then the next population, and so on. That is, providing
Site::as_mut_slice
as a buffer will be correct, given
a site of correct shape for the underlying reader.
Sourcefn read_site_unnormalised(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
fn read_site_unnormalised(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
Reads a single site into the provided buffer without normalising out of log-space.
See also documentation for Self::read_site
.