pub struct FileNode { /* private fields */ }
Expand description
File Storage Node class.
The node is used to store each and every element of the file storage opened for reading. When XML/YAML file is read, it is first parsed and stored in the memory as a hierarchical collection of nodes. Each node can be a “leaf” that is contain a single number or a string, or be a collection of other nodes. There can be named collections (mappings) where each element has a name and it is accessed by a name, and ordered collections (sequences) where elements do not have names but rather accessed by index. Type of the file node can be determined using FileNode::type method.
Note that file nodes are only used for navigating file storages opened for reading. When a file storage is opened for writing, no data is stored in memory after it is written.
Implementations§
source§impl FileNode
impl FileNode
sourcepub fn default() -> Result<FileNode>
pub fn default() -> Result<FileNode>
The constructors.
These constructors are used to create a default file node, construct it from obsolete structures or from the another file node.
sourcepub fn new(fs: &FileStorage, block_idx: size_t, ofs: size_t) -> Result<FileNode>
pub fn new(fs: &FileStorage, block_idx: size_t, ofs: size_t) -> Result<FileNode>
The constructors.
These constructors are used to create a default file node, construct it from obsolete structures or from the another file node.
Overloaded parameters
Parameters
- fs: Pointer to the file storage structure.
- blockIdx: Index of the memory block where the file node is stored
- ofs: Offset in bytes from the beginning of the serialized storage
@deprecated
sourcepub fn copy(node: &FileNode) -> Result<FileNode>
pub fn copy(node: &FileNode) -> Result<FileNode>
The constructors.
These constructors are used to create a default file node, construct it from obsolete structures or from the another file node.
Overloaded parameters
Parameters
- node: File node to be used as initialization for the created file node.