pub struct Value {
pub text: String,
pub quoted: bool,
}Expand description
A raw value token. quoted records that the token came from a quote pair,
which switches numeric interpretation to RPN.
Fields§
§text: String§quoted: boolImplementations§
Source§impl Value
impl Value
pub fn new(text: impl Into<String>) -> Self
Sourcepub fn to_f64(&self, vars: Option<&VarMap>) -> Result<f64, ValueError>
pub fn to_f64(&self, vars: Option<&VarMap>) -> Result<f64, ValueError>
TParser::MakeDouble_: quoted tokens evaluate as RPN, bare tokens must be plain numbers. An empty value is 0, as in the reference.
Sourcepub fn to_i64(&self, vars: Option<&VarMap>) -> Result<i64, ValueError>
pub fn to_i64(&self, vars: Option<&VarMap>) -> Result<i64, ValueError>
TParser::MakeInteger_: parse as a double and round.
Sourcepub fn to_rows(
&self,
vars: Option<&VarMap>,
) -> Result<Vec<Vec<f64>>, ValueError>
pub fn to_rows( &self, vars: Option<&VarMap>, ) -> Result<Vec<Vec<f64>>, ValueError>
TParser::ParseAsVector over the whole value: numbers separated by
whitespace or commas. | row terminators split a matrix value into
rows; a plain vector is one row.
Sourcepub fn to_vector(&self, vars: Option<&VarMap>) -> Result<Vec<f64>, ValueError>
pub fn to_vector(&self, vars: Option<&VarMap>) -> Result<Vec<f64>, ValueError>
A flat numeric vector (kVs, taps, ZIPV, …).
Sourcepub fn to_string_list(&self, vars: Option<&VarMap>) -> Vec<String>
pub fn to_string_list(&self, vars: Option<&VarMap>) -> Vec<String>
A list of string items (buses=(b1, b2), conns=(wye delta)).
Sourcepub fn to_bus_spec(&self) -> BusSpec
pub fn to_bus_spec(&self) -> BusSpec
TParser::ParseAsBusName: name.1.2.0 into name and node list.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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