pub enum ConfigurationValue {
Literal(String),
Number(f64),
Object(String, Vec<(String, ConfigurationValue)>),
Array(Vec<ConfigurationValue>),
Experiments(Vec<ConfigurationValue>),
NamedExperiments(String, Vec<ConfigurationValue>),
True,
False,
Where(Rc<ConfigurationValue>, Expr),
Expression(Expr),
None,
}
Variants§
Literal(String)
Number(f64)
Object(String, Vec<(String, ConfigurationValue)>)
Array(Vec<ConfigurationValue>)
Experiments(Vec<ConfigurationValue>)
NamedExperiments(String, Vec<ConfigurationValue>)
True
False
Where(Rc<ConfigurationValue>, Expr)
Expression(Expr)
None
Implementations§
Source§impl ConfigurationValue
impl ConfigurationValue
pub fn as_bool(&self) -> Result<bool, Error>
pub fn as_str(&self) -> Result<&str, Error>
pub fn as_f64(&self) -> Result<f64, Error>
pub fn as_usize(&self) -> Result<usize, Error>
pub fn as_i32(&self) -> Result<i32, Error>
pub fn as_time(&self) -> Result<Time, Error>
pub fn as_array(&self) -> Result<&Vec<ConfigurationValue>, Error>
pub fn as_expr(&self) -> Result<&Expr, Error>
Sourcepub fn ill(&self, message: &str) -> Error
pub fn ill(&self, message: &str) -> Error
Build a generic IllFormedConfiguration error from this ConfigurationValue.
Sourcepub fn to_csv_field(&self) -> String
pub fn to_csv_field(&self) -> String
Convert this value into some string without newlines or commas.
If not possible just return "error".to_string()
.
XXX: we could make a or_else
method receiving a Fn()->String
.
pub fn rename(&mut self, new_name: String)
pub fn depth(&self) -> u32
Sourcepub fn format_terminal(&self) -> String
pub fn format_terminal(&self) -> String
A formatter for terminal session.
Sourcepub fn format_terminal_nesting(&self, nesting: u32) -> String
pub fn format_terminal_nesting(&self, nesting: u32) -> String
A formatter for terminal session.
nesting
is the number of indentations or levels through to the current point.
*
Sourcepub fn format_latex(&self) -> String
pub fn format_latex(&self) -> String
A formatter for terminal session.
Sourcepub fn format_latex_nesting(&self, nesting: u32) -> String
pub fn format_latex_nesting(&self, nesting: u32) -> String
A formatter for terminal session.
nesting
is the number of indentations or levels through to the current point.
*
Trait Implementations§
Source§impl Clone for ConfigurationValue
impl Clone for ConfigurationValue
Source§fn clone(&self) -> ConfigurationValue
fn clone(&self) -> ConfigurationValue
Returns a copy 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 ConfigurationValue
impl Debug for ConfigurationValue
Source§impl Default for ConfigurationValue
impl Default for ConfigurationValue
Source§fn default() -> ConfigurationValue
fn default() -> ConfigurationValue
Returns the “default value” for a type. Read more
Source§impl Display for ConfigurationValue
impl Display for ConfigurationValue
Source§impl<'a> From<&'a ConfigurationValue> for ArrangementBuilderArgument<'a>
impl<'a> From<&'a ConfigurationValue> for ArrangementBuilderArgument<'a>
Source§fn from(cv: &'a ConfigurationValue) -> Self
fn from(cv: &'a ConfigurationValue) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ConfigurationValue
impl PartialEq for ConfigurationValue
Source§impl PartialOrd for ConfigurationValue
impl PartialOrd for ConfigurationValue
Source§impl Quantifiable for ConfigurationValue
impl Quantifiable for ConfigurationValue
Source§fn total_memory(&self) -> usize
fn total_memory(&self) -> usize
Get the total memory currently being employed by the implementing type. Both stack and heap.
Source§fn print_memory_breakdown(&self)
fn print_memory_breakdown(&self)
Prints by stdout how much memory is used per component.
Source§fn forecast_total_memory(&self) -> usize
fn forecast_total_memory(&self) -> usize
Get an estimation on how much memory the type could reach during the simulation.
impl StructuralPartialEq for ConfigurationValue
Auto Trait Implementations§
impl Freeze for ConfigurationValue
impl RefUnwindSafe for ConfigurationValue
impl !Send for ConfigurationValue
impl !Sync for ConfigurationValue
impl Unpin for ConfigurationValue
impl UnwindSafe for ConfigurationValue
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