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

Method is_error

aiscript-vm/src/value.rs:243–251  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

241 }
242
243 pub fn is_error(&self) -> bool {
244 match self {
245 // Check instance of error class (NetworkError!)
246 Value::Instance(instance) => instance.borrow().class.borrow().is_error_type(),
247 // Check enum variant from error enum (IOError!::ReadError)
248 Value::EnumVariant(variant) => variant.enum_.borrow().is_error_type(),
249 _ => false,
250 }
251 }
252
253 pub fn is_object(&self) -> bool {
254 matches!(self, Value::Object(_))

Callers 1

dispatch_nextMethod · 0.80

Calls 2

is_error_typeMethod · 0.45
borrowMethod · 0.45

Tested by

no test coverage detected