#[repr(transparent)]
pub struct RawValue(_, _);
Expand description

An unsafe value used internally in the VM.

Does not provide any safety guarantees as to GC’d object lifetimes. You almost always want Value instead of this.

Implementations

Hashes the value. Note that this is not part of a std::hash::Hash implementation because this may get extra arguments in the future to support overloading hashing from the language itself.

Returns the kind of value stored.

Returns a boolean value without performing any checks.

Safety

Calling this on a value that isn’t known to be a boolean is undefined behavior.

Returns a number value without performing any checks.

Safety

Calling this on a value that isn’t known to be a number is undefined behavior.

Returns a string value without performing any checks.

Safety

Calling this on a value that isn’t known to be a string is undefined behavior.

Returns a function value without performing any checks.

Safety

Calling this on a value that isn’t known to be a function is undefined behavior.

Returns a struct value without performing any checks.

Safety

Calling this on a value that isn’t known to be a struct is undefined behavior.

Returns a trait value without performing any checks.

Safety

Calling this on a value that isn’t known to be a trait is undefined behavior.

Returns a list value without performing any checks.

Safety

Calling this on a value that isn’t known to be a list is undefined behavior.

Returns a dict value without performing any checks.

Safety

Calling this on a value that isn’t known to be a dict is undefined behavior.

Returns a user data value without performing any checks.

Safety

Calling this on a value that isn’t known to be a user data is undefined behavior.

Ensures the value is a Nil, returning a type mismatch error if that’s not the case.

Ensures the value is a Boolean, returning a type mismatch error if that’s not the case.

Ensures the value is a Number, returning a type mismatch error if that’s not the case.

Ensures the value is a String, returning a type mismatch error if that’s not the case.

Ensures the value is a Function, returning a type mismatch error if that’s not the case.

Ensures the value is a Struct, returning a type mismatch error if that’s not the case.

Ensures the value is a Trait, returning a type mismatch error if that’s not the case.

Ensures the value is a UserData of the given type T, returning a type mismatch error that’s not the case.

Returns whether the value is truthy. All values except Nil and False are truthy.

Returns whether the values is falsy. The only falsy values are Nil and False.

Attempts to partially compare this value with another one.

Returns an error if the types of the two values are not the same.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.