pub struct Hello {
pub abi_major: u16,
pub abi_minor: u16,
pub window_bytes: u64,
pub max_batch_rows: u64,
pub offered: CapabilitySet,
pub source_bytes: u64,
}Expand description
The host introducing itself.
Fields§
§abi_major: u16The major ABI version the host speaks. A mismatch here is fatal.
abi_minor: u16The minor ABI version the host speaks. A mismatch here is not fatal.
window_bytes: u64How many bytes of the source the host is willing to keep visible to the guest at once.
Zero means the host will map the whole source and the decoder never has to think about windows.
max_batch_rows: u64The largest number of rows the host will ask for in one scan request.
offered: CapabilitySetWhat the host can do.
source_bytes: u64How many bytes the source has in total, or zero if the host is not saying.
A decoder that has to find its own footer needs this, and a decoder that reads forwards from the start does not, which is why zero is allowed rather than being an error.
This field was appended after the ABI shipped, so it is the first real exercise of the
grow-at-the-end rule. A host built before it existed writes a Hello that ends after
offered, and a decoder built after it reads zero and carries on.
Implementations§
Source§impl Hello
impl Hello
Sourcepub fn decode(version: u16, p: &mut Reader<'_>) -> Result<Self>
pub fn decode(version: u16, p: &mut Reader<'_>) -> Result<Self>
Reads the record from its payload.
§Errors
Returns Error::UnsupportedVersion if the layout version is not one this build knows, or
Error::Truncated if the payload ends early.