pub struct ParameterCollection { /* private fields */ }Expand description
Collection of key-value parameters.
Preserves insertion order and supports nested parameter strings.
Implementations§
Source§impl ParameterCollection
impl ParameterCollection
Sourcepub fn from_string(data: &str) -> Self
pub fn from_string(data: &str) -> Self
Creates a parameter collection from a string.
Sourcepub fn from_string_with_level(data: &str, level: usize) -> Self
pub fn from_string_with_level(data: &str, level: usize) -> Self
Creates a parameter collection from a string at a specific nesting level.
Sourcepub fn contains(&self, key: &str) -> bool
pub fn contains(&self, key: &str) -> bool
Returns true if the collection contains the given key.
Sourcepub fn get(&self, key: &str) -> Option<ParameterValue>
pub fn get(&self, key: &str) -> Option<ParameterValue>
Gets a parameter value by key.
Sourcepub fn get_or(&self, key: &str, default: &str) -> ParameterValue
pub fn get_or(&self, key: &str, default: &str) -> ParameterValue
Gets a parameter value by key, or returns a default value.
Sourcepub fn get_at(&self, index: usize) -> Option<(&str, ParameterValue)>
pub fn get_at(&self, index: usize) -> Option<(&str, ParameterValue)>
Gets the value at the given index.
Sourcepub fn index_of(&self, key: &str) -> Option<usize>
pub fn index_of(&self, key: &str) -> Option<usize>
Returns the index of a key, or None if not found.
Sourcepub fn add_double(&mut self, key: &str, value: f64, decimals: usize)
pub fn add_double(&mut self, key: &str, value: f64, decimals: usize)
Adds a double value with specified decimal places.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, ParameterValue)>
pub fn iter(&self) -> impl Iterator<Item = (&str, ParameterValue)>
Returns an iterator over (key, value) pairs.
Sourcepub fn set_use_long_booleans(&mut self, value: bool)
pub fn set_use_long_booleans(&mut self, value: bool)
Sets whether to use long boolean format.
Sourcepub fn to_param_string(&self) -> String
pub fn to_param_string(&self) -> String
Converts the collection back to a parameter string.
Trait Implementations§
Source§impl Clone for ParameterCollection
impl Clone for ParameterCollection
Source§fn clone(&self) -> ParameterCollection
fn clone(&self) -> ParameterCollection
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 ParameterCollection
impl Debug for ParameterCollection
Source§impl Default for ParameterCollection
impl Default for ParameterCollection
Source§fn default() -> ParameterCollection
fn default() -> ParameterCollection
Returns the “default value” for a type. Read more
Source§impl Display for ParameterCollection
impl Display for ParameterCollection
Source§impl FromBinary for ParameterCollection
impl FromBinary for ParameterCollection
Source§impl<'a> IntoIterator for &'a ParameterCollection
impl<'a> IntoIterator for &'a ParameterCollection
Auto Trait Implementations§
impl Freeze for ParameterCollection
impl RefUnwindSafe for ParameterCollection
impl Send for ParameterCollection
impl Sync for ParameterCollection
impl Unpin for ParameterCollection
impl UnwindSafe for ParameterCollection
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