pub enum EvalValue {
Bool(bool),
Integer(i64),
BigInteger(BigInt),
Double(f64),
String(String),
}Expand description
A value that can be bound to an XPath variable at evaluation time.
This enum provides ergonomic conversion from Rust types to XPath values
via the From trait implementations. You can use Rust literals directly:
// All of these work:
expr.evaluator(&ctx).with_variable("x", 42); // i32 -> Integer
expr.evaluator(&ctx).with_variable("x", 3.14); // f64 -> Double
expr.evaluator(&ctx).with_variable("x", true); // bool -> Bool
expr.evaluator(&ctx).with_variable("x", "hello"); // &str -> StringVariants§
Bool(bool)
Boolean value
Integer(i64)
Small integer (converted to BigInt internally)
BigInteger(BigInt)
Big integer
Double(f64)
Double-precision floating point
String(String)
String value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EvalValue
impl RefUnwindSafe for EvalValue
impl Send for EvalValue
impl Sync for EvalValue
impl Unpin for EvalValue
impl UnsafeUnpin for EvalValue
impl UnwindSafe for EvalValue
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