MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / as_number

Method as_number

aiscript-vm/src/value.rs:163–171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

161 }
162
163 pub fn as_number(self) -> Result<f64, VmError> {
164 match self {
165 Value::Number(value) => Ok(value),
166 a => Err(VmError::RuntimeError(format!(
167 "cannot convert to number: {}",
168 a
169 ))),
170 }
171 }
172
173 pub fn as_boolean(&self) -> bool {
174 match self {

Callers 5

build_claimsFunction · 0.80
create_access_tokenFunction · 0.80
responseFunction · 0.80
dispatch_nextMethod · 0.80
validateMethod · 0.80

Calls 1

RuntimeErrorClass · 0.85

Tested by

no test coverage detected