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: &impl FileStorageTraitConst,
block_idx: size_t,
ofs: size_t,
) -> Result<FileNode>
pub fn new( fs: &impl FileStorageTraitConst, 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: &impl FileNodeTraitConst) -> Result<FileNode>
pub fn copy(node: &impl FileNodeTraitConst) -> Result<FileNode>
pub fn is_map(flags: i32) -> Result<bool>
pub fn is_seq(flags: i32) -> Result<bool>
pub fn is_collection(flags: i32) -> Result<bool>
pub fn is_empty_collection(flags: i32) -> Result<bool>
pub fn is_flow(flags: i32) -> Result<bool>
Trait Implementations§
source§impl Boxed for FileNode
impl Boxed for FileNode
source§unsafe fn from_raw(ptr: <FileNode as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <FileNode as OpenCVFromExtern>::ExternReceive) -> Self
source§fn into_raw(self) -> <FileNode as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <FileNode as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <FileNode as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <FileNode as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(
&mut self,
) -> <FileNode as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self, ) -> <FileNode as OpenCVTypeExternContainer>::ExternSendMut
source§impl FileNodeTrait for FileNode
impl FileNodeTrait for FileNode
source§impl FileNodeTraitConst for FileNode
impl FileNodeTraitConst for FileNode
fn as_raw_FileNode(&self) -> *const c_void
fn block_idx(&self) -> size_t
fn ofs(&self) -> size_t
source§fn get(&self, nodename: &str) -> Result<FileNode>
fn get(&self, nodename: &str) -> Result<FileNode>
source§fn get_node(&self, nodename: &str) -> Result<FileNode>
fn get_node(&self, nodename: &str) -> Result<FileNode>
source§fn at(&self, i: i32) -> Result<FileNode>
fn at(&self, i: i32) -> Result<FileNode>
source§fn name(&self) -> Result<String>
fn name(&self) -> Result<String>
source§fn size(&self) -> Result<size_t>
fn size(&self) -> Result<size_t>
source§fn to_i32(&self) -> Result<i32>
fn to_i32(&self) -> Result<i32>
fn ptr(&self) -> Result<*const u8>
source§fn begin(&self) -> Result<FileNodeIterator>
fn begin(&self) -> Result<FileNodeIterator>
source§fn end(&self) -> Result<FileNodeIterator>
fn end(&self) -> Result<FileNodeIterator>
impl Send for FileNode
Auto Trait Implementations§
impl Freeze for FileNode
impl RefUnwindSafe for FileNode
impl !Sync for FileNode
impl Unpin for FileNode
impl UnwindSafe for FileNode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more