Skip to main content

fetch_footer

Function fetch_footer 

Source
async fn fetch_footer(
    io: &dyn WalObjectIo,
    object: &ListedObject,
) -> Result<(Header, Vec<FooterEntry>, Option<Bytes>)>
Expand description

Reads the header, trailer and footer of object and verifies them: the header must carry the sequence of the key, the trailer must be well formed, the footer must match the checksum the trailer holds and its segments must tile the object body. Also returns a copy of the segment of release records when the bytes read hold it and it is at most MAX_KEPT_RELEASE_BYTES, which is not decoded here.

A short object is read whole. Otherwise the header and a window at the end of the object are read concurrently, and the footer is read separately only when it starts before the window.