pub struct Layout {
pub format_version: Version,
pub standard_version: Option<Version>,
pub comments: Vec<String>,
pub tree: Option<Range<usize>>,
pub blocks: Vec<BlockLocation>,
pub block_index_pos: Option<u64>,
pub block_index_offsets: Vec<u64>,
pub index_rejection: Option<IndexRejection>,
}Expand description
The result of scanning a file.
Fields§
§format_version: VersionThe low-level format version from the #ASDF line.
standard_version: Option<Version>The standard version from the #ASDF_STANDARD comment, if present.
comments: Vec<String>Any other comment lines between the header and the tree, without their
leading # or trailing newline.
tree: Option<Range<usize>>Byte range of the YAML tree, if the file has one.
blocks: Vec<BlockLocation>The blocks, in file order.
block_index_pos: Option<u64>Byte offset of the block index header, if one was found.
block_index_offsets: Vec<u64>The offsets listed in the block index, whether or not it was accepted.
Kept even when the index is rejected: the low-level event API reports what the file says, and leaves judging it to the reader.
index_rejection: Option<IndexRejection>Why the block index was not used, if it was found but rejected.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn has_tree(&self) -> bool
pub fn has_tree(&self) -> bool
Whether the file carries a YAML tree.
A file in exploded form may legitimately have none.
Sourcepub fn tree_str<'a>(&self, buf: &'a [u8]) -> Option<&'a str>
pub fn tree_str<'a>(&self, buf: &'a [u8]) -> Option<&'a str>
The tree text, given the buffer it was scanned from.
Sourcepub fn used_block_index(&self) -> bool
pub fn used_block_index(&self) -> bool
Whether a block index was present and accepted.