pub struct ParsedSourceName { /* private fields */ }Expand description
A source name split around its printf-style block substitutions —
H5D_virtual_parse_source_name (H5Dvirtual.c).
A virtual dataset whose virtual selection is unlimited and whose source
selection is not draws each block of the virtual selection from a
different source dataset, named by substituting the block index into
the stored name. Only two conversions are legal: %b, the block index,
and %%, an escaped literal %. Anything else is “invalid format
specifier”, and libhdf5 raises it both when the mapping is set and when
the layout is loaded back out of the file, so a name that does not parse
makes the dataset unopenable rather than merely unwritable.
Implementations§
Source§impl ParsedSourceName
impl ParsedSourceName
Sourcepub fn nsubs(&self) -> usize
pub fn nsubs(&self) -> usize
How many %b substitutions the name carries — upstream’s nsubs,
the quantity H5D_virtual_check_mapping_post tests to decide whether
a mapping is a printf mapping at all.
Sourcepub fn build(&self, blockno: u64) -> String
pub fn build(&self, blockno: u64) -> String
The name block blockno resolves to —
H5D__virtual_build_source_name. With no substitutions this is the
unescaped name, which is what upstream uses for an ordinary mapping
too (H5D__virtual_load_layout takes parsed_name->name_segment,
not the stored string, whenever the name parsed into one).