pub trait Debug {
type Value: Value;
// Required methods
fn inspect_type_name_for_value(&mut self, value: Self::Value) -> &str;
fn class_name_for_value(&mut self, value: Self::Value) -> &str;
}
Expand description
Debugging and Exception
message support.
Required Associated Types§
Required Methods§
Sourcefn inspect_type_name_for_value(&mut self, value: Self::Value) -> &str
fn inspect_type_name_for_value(&mut self, value: Self::Value) -> &str
Return a name for the given value’s type that is suitable for using in
an Exception
message.
Some immediate types like true
, false
, and nil
are shown by value
rather than by class.
This function suppresses all errors and returns an empty string on error.
Sourcefn class_name_for_value(&mut self, value: Self::Value) -> &str
fn class_name_for_value(&mut self, value: Self::Value) -> &str
Return the class name for the given value’s type.
Even immediate types will have their class name spelled out. For
example, calling this function with nil
will return "NilClass"
.
This function suppresses all errors and returns an empty string on error.