pub trait ReceiveHeader<B: Backend> {
// Required method
fn get_header_bytes(&mut self, bytes: &mut [u8; 512]) -> Result<(), B::Err>;
}
Expand description
Trait used to receive the header of a container.
The container uses the ReceiveHeader::get_header_bytes()
method to ask
the backend for the header bytes. The container does not know where the
backend stores the header, that’s why such a method is used. Not more than
HEADER_MAX_SIZE
bytes can be stored in the header.
Required Methods§
Sourcefn get_header_bytes(&mut self, bytes: &mut [u8; 512]) -> Result<(), B::Err>
fn get_header_bytes(&mut self, bytes: &mut [u8; 512]) -> Result<(), B::Err>
Receives the binary header data from the backend.
The container uses this method to ask the backend for the header bytes.
The container does not know where the backend stores the header, that’s
why such a method is used. Not more than HEADER_MAX_SIZE
bytes can
be stored in the header.
The method should put the data into the bytes
slice.