pub struct ParamsContainer { /* private fields */ }Expand description
Container for parameter-format records.
Used for schematic files where records are pipe-delimited parameters.
Implementations§
Source§impl ParamsContainer
impl ParamsContainer
Sourcepub fn from_blocks(source: &str, blocks: &[Block]) -> Self
pub fn from_blocks(source: &str, blocks: &[Block]) -> Self
Creates a container from a stream path and blocks.
Sourcepub fn from_params_list(
source: &str,
params_list: Vec<ParameterCollection>,
) -> Self
pub fn from_params_list( source: &str, params_list: Vec<ParameterCollection>, ) -> Self
Creates a container from raw parameter strings.
Sourcepub fn get(&self, index: usize) -> Option<&GenericRecord>
pub fn get(&self, index: usize) -> Option<&GenericRecord>
Gets a record by index.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut GenericRecord>
pub fn get_mut(&mut self, index: usize) -> Option<&mut GenericRecord>
Gets a mutable record by index.
Sourcepub fn iter(&self) -> impl Iterator<Item = &GenericRecord>
pub fn iter(&self) -> impl Iterator<Item = &GenericRecord>
Iterates over all records.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut GenericRecord>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut GenericRecord>
Iterates mutably over all records.
Sourcepub fn filter_by_type(
&self,
record_id: i32,
) -> impl Iterator<Item = &GenericRecord>
pub fn filter_by_type( &self, record_id: i32, ) -> impl Iterator<Item = &GenericRecord>
Filters records by record ID.
Sourcepub fn find<F>(&self, pred: F) -> Option<&GenericRecord>
pub fn find<F>(&self, pred: F) -> Option<&GenericRecord>
Finds the first record matching a predicate.
Sourcepub fn find_all<F>(&self, pred: F) -> Vec<&GenericRecord>
pub fn find_all<F>(&self, pred: F) -> Vec<&GenericRecord>
Finds all records matching a predicate.
Sourcepub fn is_modified(&self) -> bool
pub fn is_modified(&self) -> bool
Returns true if any records were modified.
Sourcepub fn push(&mut self, record: GenericRecord)
pub fn push(&mut self, record: GenericRecord)
Adds a record to the container.
Sourcepub fn remove(&mut self, index: usize) -> Option<GenericRecord>
pub fn remove(&mut self, index: usize) -> Option<GenericRecord>
Removes a record by index.
Sourcepub fn to_params_list(&self) -> Vec<ParameterCollection>
pub fn to_params_list(&self) -> Vec<ParameterCollection>
Converts all records back to parameter collections.
Trait Implementations§
Source§impl Clone for ParamsContainer
impl Clone for ParamsContainer
Source§fn clone(&self) -> ParamsContainer
fn clone(&self) -> ParamsContainer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParamsContainer
impl Debug for ParamsContainer
Source§impl<'a> IntoIterator for &'a ParamsContainer
impl<'a> IntoIterator for &'a ParamsContainer
Source§impl IntoIterator for ParamsContainer
impl IntoIterator for ParamsContainer
Auto Trait Implementations§
impl Freeze for ParamsContainer
impl RefUnwindSafe for ParamsContainer
impl Send for ParamsContainer
impl Sync for ParamsContainer
impl Unpin for ParamsContainer
impl UnwindSafe for ParamsContainer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more