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

Method as_class

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

Source from the content-addressed store, hash-verified

232 }
233
234 pub fn as_class(self) -> Result<GcRefLock<'gc, Class<'gc>>, VmError> {
235 match self {
236 Value::Class(class) => Ok(class),
237 v => Err(VmError::RuntimeError(format!(
238 "cannot convert to class, the value is {v}"
239 ))),
240 }
241 }
242
243 pub fn is_error(&self) -> bool {
244 match self {

Callers 1

dispatch_nextMethod · 0.80

Calls 1

RuntimeErrorClass · 0.85

Tested by

no test coverage detected