pub struct FrameView<'a> {
pub simbox: Option<&'a SimBox>,
pub meta: &'a HashMap<String, String>,
/* private fields */
}Expand description
Fields§
§simbox: Option<&'a SimBox>Borrowed simulation box, if present.
meta: &'a HashMap<String, String>Borrowed metadata map.
Implementations§
Source§impl<'a> FrameView<'a>
impl<'a> FrameView<'a>
Sourcepub fn from_parts(
map: HashMap<&'a str, BlockView<'a>>,
simbox: Option<&'a SimBox>,
meta: &'a HashMap<String, String>,
) -> FrameView<'a>
pub fn from_parts( map: HashMap<&'a str, BlockView<'a>>, simbox: Option<&'a SimBox>, meta: &'a HashMap<String, String>, ) -> FrameView<'a>
Construct a FrameView from parts.
Sourcepub fn get(&self, key: &str) -> Option<&BlockView<'a>>
pub fn get(&self, key: &str) -> Option<&BlockView<'a>>
Gets an immutable reference to the block view for key if present.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&&'a str, &BlockView<'a>)>
pub fn iter(&self) -> impl Iterator<Item = (&&'a str, &BlockView<'a>)>
Returns an iterator over (&str, &BlockView).
Sourcepub fn values(&self) -> impl Iterator<Item = &BlockView<'a>>
pub fn values(&self) -> impl Iterator<Item = &BlockView<'a>>
Returns an iterator over block view references.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true if the view contains the specified block key.
Trait Implementations§
Source§impl FrameAccess for FrameView<'_>
impl FrameAccess for FrameView<'_>
Source§fn get_float(
&self,
block_key: &str,
col_key: &str,
) -> Option<ArrayBase<ViewRepr<&f64>, Dim<IxDynImpl>>>
fn get_float( &self, block_key: &str, col_key: &str, ) -> Option<ArrayBase<ViewRepr<&f64>, Dim<IxDynImpl>>>
Gets a float array view from a column inside a block.
Source§fn get_int(
&self,
block_key: &str,
col_key: &str,
) -> Option<ArrayBase<ViewRepr<&i32>, Dim<IxDynImpl>>>
fn get_int( &self, block_key: &str, col_key: &str, ) -> Option<ArrayBase<ViewRepr<&i32>, Dim<IxDynImpl>>>
Gets an int array view from a column inside a block.
Source§fn get_bool(
&self,
block_key: &str,
col_key: &str,
) -> Option<ArrayBase<ViewRepr<&bool>, Dim<IxDynImpl>>>
fn get_bool( &self, block_key: &str, col_key: &str, ) -> Option<ArrayBase<ViewRepr<&bool>, Dim<IxDynImpl>>>
Gets a bool array view from a column inside a block.
Source§fn get_uint(
&self,
block_key: &str,
col_key: &str,
) -> Option<ArrayBase<ViewRepr<&u32>, Dim<IxDynImpl>>>
fn get_uint( &self, block_key: &str, col_key: &str, ) -> Option<ArrayBase<ViewRepr<&u32>, Dim<IxDynImpl>>>
Gets a uint array view from a column inside a block.
Source§fn get_u8(
&self,
block_key: &str,
col_key: &str,
) -> Option<ArrayBase<ViewRepr<&u8>, Dim<IxDynImpl>>>
fn get_u8( &self, block_key: &str, col_key: &str, ) -> Option<ArrayBase<ViewRepr<&u8>, Dim<IxDynImpl>>>
Gets a u8 array view from a column inside a block.
Source§fn get_string(
&self,
block_key: &str,
col_key: &str,
) -> Option<ArrayBase<ViewRepr<&String>, Dim<IxDynImpl>>>
fn get_string( &self, block_key: &str, col_key: &str, ) -> Option<ArrayBase<ViewRepr<&String>, Dim<IxDynImpl>>>
Gets a string array view from a column inside a block.
Source§fn simbox_ref(&self) -> Option<&SimBox>
fn simbox_ref(&self) -> Option<&SimBox>
Returns a reference to the simulation box, if present.
Source§fn block_keys(&self) -> Vec<&str>
fn block_keys(&self) -> Vec<&str>
Returns block keys as a
Vec.Source§fn contains_block(&self, key: &str) -> bool
fn contains_block(&self, key: &str) -> bool
Returns
true if the frame contains the specified block key.Source§fn block_count(&self) -> usize
fn block_count(&self) -> usize
Number of blocks.
Source§fn visit_block<R>(
&self,
key: &str,
f: impl FnOnce(&dyn BlockAccess) -> R,
) -> Option<R>
fn visit_block<R>( &self, key: &str, f: impl FnOnce(&dyn BlockAccess) -> R, ) -> Option<R>
Visits a block by key through the
BlockAccess trait, using the visitor pattern
to avoid lifetime/return-type issues. Returns None if the block does not exist.Auto Trait Implementations§
impl<'a> Freeze for FrameView<'a>
impl<'a> RefUnwindSafe for FrameView<'a>
impl<'a> Send for FrameView<'a>
impl<'a> Sync for FrameView<'a>
impl<'a> Unpin for FrameView<'a>
impl<'a> UnsafeUnpin for FrameView<'a>
impl<'a> UnwindSafe for FrameView<'a>
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
Mutably borrows from an owned value. Read more