pub struct LinkMessage {
pub name: String,
pub target: LinkTarget,
pub creation_order: Option<i64>,
pub cset: CharacterSet,
}Expand description
Link message payload.
Fields§
§name: String§target: LinkTarget§creation_order: Option<i64>Creation order within the parent group, present only when the group
tracks it (H5O_LINK_STORE_CORDER). H5G_obj_insert stamps it from
the Link Info message’s running maximum.
cset: CharacterSetCharacter set of name (H5O_LINK_STORE_NAME_CSET).
Implementations§
Source§impl LinkMessage
impl LinkMessage
Sourcepub fn external(name: &str, file: &str, path: &str) -> Self
pub fn external(name: &str, file: &str, path: &str) -> Self
Create an external link to path inside file.
Sourcepub fn with_creation_order(self, corder: i64) -> Self
pub fn with_creation_order(self, corder: i64) -> Self
The same link, stamped with its creation order.
Sourcepub fn with_cset(self, cset: CharacterSet) -> Self
pub fn with_cset(self, cset: CharacterSet) -> Self
The same link, stamped with a character set the name does not imply.
The one producer that needs it is the symbol table: an entry carries no
character set field, so H5G__ent_to_link gives every link it builds
H5F_DEFAULT_CSET (H5Gent.c:372) whatever the name’s bytes are. A
group libhdf5 wrote can therefore hold a high-byte name under Ascii,
and re-deriving the set from the name would convert that group out of
its symbol table on a rewrite.
Sourcepub fn fits_symbol_table(&self) -> bool
pub fn fits_symbol_table(&self) -> bool
Whether a version-1 symbol table entry can express this link.
H5G_obj_insert asks it as one condition with two halves
(obj_lnk->cset != H5T_CSET_ASCII || obj_lnk->type > H5L_TYPE_BUILTIN_MAX, H5Gobj.c:514), and converts the whole group to
link messages the moment either holds.
The entry has three cache types — nothing cached, an object header
address with the target group’s own symbol table beside it, and a soft
link’s offset into the local heap — and no room for a fourth, so the
user-defined classes, H5L_TYPE_EXTERNAL among them, exist only as
link messages. It has no character set field either, so a link whose
set is not the file default cannot be stored in one without losing it.