pub trait ExprExtension {
// Required method
fn get_self(&self) -> &Expr;
// Provided methods
fn as_unsigned_integer<T>(&self) -> Result<T>
where T: FromStr,
T::Err: Display { ... }
fn as_signed_integer<T>(&self) -> Result<T>
where T: FromStr + Neg<Output = T>,
T::Err: Display { ... }
fn as_unsigned_float<T>(&self) -> Result<T>
where T: FromStr,
T::Err: Display { ... }
fn as_float<T>(&self) -> Result<T>
where T: FromStr + Neg<Output = T>,
T::Err: Display { ... }
fn as_string(&self) -> Result<String> { ... }
fn as_bool(&self) -> Result<bool> { ... }
fn as_path(&self) -> Result<&Path> { ... }
}Required Methods§
Provided Methods§
Sourcefn as_unsigned_integer<T>(&self) -> Result<T>
fn as_unsigned_integer<T>(&self) -> Result<T>
Returns the integer value of the expression if it is a literal unsigned integer.
Sourcefn as_signed_integer<T>(&self) -> Result<T>
fn as_signed_integer<T>(&self) -> Result<T>
Returns the integer value of the expression if it is a literal signed integer.
fn as_unsigned_float<T>(&self) -> Result<T>
fn as_float<T>(&self) -> Result<T>
Sourcefn as_string(&self) -> Result<String>
fn as_string(&self) -> Result<String>
Returns the string value of the expression if it is a literal string.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.