Trait FileStorageTraitConst

Source
pub trait FileStorageTraitConst {
    // Required method
    fn as_raw_FileStorage(&self) -> *const c_void;

    // Provided methods
    fn state(&self) -> i32 { ... }
    fn elname(&self) -> String { ... }
    fn is_opened(&self) -> Result<bool> { ... }
    fn get_first_top_level_node(&self) -> Result<FileNode> { ... }
    fn root(&self, streamidx: i32) -> Result<FileNode> { ... }
    fn root_def(&self) -> Result<FileNode> { ... }
    fn get(&self, nodename: &str) -> Result<FileNode> { ... }
    fn get_node(&self, nodename: &str) -> Result<FileNode> { ... }
    fn get_format(&self) -> Result<i32> { ... }
}
Expand description

Constant methods for core::FileStorage

Required Methods§

Provided Methods§

Source

fn state(&self) -> i32

Source

fn elname(&self) -> String

Source

fn is_opened(&self) -> Result<bool>

Checks whether the file is opened.

§Returns

true if the object is associated with the current file and false otherwise. It is a good practice to call this method after you tried to open a file.

Source

fn get_first_top_level_node(&self) -> Result<FileNode>

Returns the first element of the top-level mapping.

§Returns

The first element of the top-level mapping.

Source

fn root(&self, streamidx: i32) -> Result<FileNode>

Returns the top-level mapping

§Parameters
  • streamidx: Zero-based index of the stream. In most cases there is only one stream in the file. However, YAML supports multiple streams and so there can be several.
§Returns

The top-level mapping.

§C++ default parameters
  • streamidx: 0
Source

fn root_def(&self) -> Result<FileNode>

Returns the top-level mapping

§Parameters
  • streamidx: Zero-based index of the stream. In most cases there is only one stream in the file. However, YAML supports multiple streams and so there can be several.
§Returns

The top-level mapping.

§Note

This alternative version of FileStorageTraitConst::root function uses the following default values for its arguments:

  • streamidx: 0
Source

fn get(&self, nodename: &str) -> Result<FileNode>

Returns the specified element of the top-level mapping.

§Parameters
  • nodename: Name of the file node.
§Returns

Node with the given name.

Source

fn get_node(&self, nodename: &str) -> Result<FileNode>

Returns the specified element of the top-level mapping.

§Parameters
  • nodename: Name of the file node.
§Returns

Node with the given name.

§Overloaded parameters
Source

fn get_format(&self) -> Result<i32>

Returns the current format.

§Returns

The current format, see FileStorage::Mode

Implementors§