#[repr(transparent)]pub struct RawSelf<'a>(_);
Expand description
Wrapper struct for marking functions that use the with-raw-self calling convention.
This Deref
s to the inner value.
Methods from Deref<Target = RawValue>
sourcepub unsafe fn get_boolean_unchecked(&self) -> bool
pub unsafe fn get_boolean_unchecked(&self) -> bool
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.
sourcepub unsafe fn get_number_unchecked(&self) -> &f64
pub unsafe fn get_number_unchecked(&self) -> &f64
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.
sourcepub unsafe fn get_raw_string_unchecked(&self) -> GcRaw<String>
pub unsafe fn get_raw_string_unchecked(&self) -> GcRaw<String>
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.
sourcepub unsafe fn get_raw_function_unchecked(&self) -> GcRaw<Closure>
pub unsafe fn get_raw_function_unchecked(&self) -> GcRaw<Closure>
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.
sourcepub unsafe fn get_raw_struct_unchecked(&self) -> GcRaw<Struct>
pub unsafe fn get_raw_struct_unchecked(&self) -> GcRaw<Struct>
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.
sourcepub unsafe fn get_raw_trait_unchecked(&self) -> GcRaw<Trait>
pub unsafe fn get_raw_trait_unchecked(&self) -> GcRaw<Trait>
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.
sourcepub unsafe fn get_raw_list_unchecked(&self) -> GcRaw<List>
pub unsafe fn get_raw_list_unchecked(&self) -> GcRaw<List>
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.
sourcepub unsafe fn get_raw_dict_unchecked(&self) -> GcRaw<Dict>
pub unsafe fn get_raw_dict_unchecked(&self) -> GcRaw<Dict>
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.
sourcepub unsafe fn get_raw_user_data_unchecked(
&self
) -> GcRaw<Box<dyn UserData + 'static, Global>>
pub unsafe fn get_raw_user_data_unchecked(
&self
) -> GcRaw<Box<dyn UserData + 'static, Global>>
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.
sourcepub fn ensure_nil(&self) -> Result<(), ErrorKind>
pub fn ensure_nil(&self) -> Result<(), ErrorKind>
Ensures the value is a Nil
, returning a type mismatch error if that’s not the case.
sourcepub fn ensure_boolean(&self) -> Result<bool, ErrorKind>
pub fn ensure_boolean(&self) -> Result<bool, ErrorKind>
Ensures the value is a Boolean
, returning a type mismatch error if that’s not the case.
sourcepub fn ensure_number(&self) -> Result<f64, ErrorKind>
pub fn ensure_number(&self) -> Result<f64, ErrorKind>
Ensures the value is a Number
, returning a type mismatch error if that’s not the case.
sourcepub fn ensure_raw_string(&self) -> Result<GcRaw<String>, ErrorKind>
pub fn ensure_raw_string(&self) -> Result<GcRaw<String>, ErrorKind>
Ensures the value is a String
, returning a type mismatch error if that’s not the case.
sourcepub fn ensure_raw_function(&self) -> Result<GcRaw<Closure>, ErrorKind>
pub fn ensure_raw_function(&self) -> Result<GcRaw<Closure>, ErrorKind>
Ensures the value is a Function
, returning a type mismatch error if that’s not the case.
sourcepub fn ensure_raw_struct(&self) -> Result<GcRaw<Struct>, ErrorKind>
pub fn ensure_raw_struct(&self) -> Result<GcRaw<Struct>, ErrorKind>
Ensures the value is a Struct
, returning a type mismatch error if that’s not the case.
sourcepub fn ensure_raw_trait(&self) -> Result<GcRaw<Trait>, ErrorKind>
pub fn ensure_raw_trait(&self) -> Result<GcRaw<Trait>, ErrorKind>
Ensures the value is a Trait
, returning a type mismatch error if that’s not the case.
sourcepub fn get_raw_user_data<T>(
&self
) -> Option<GcRaw<Box<dyn UserData + 'static, Global>>>where
T: UserData,
pub fn get_raw_user_data<T>(
&self
) -> Option<GcRaw<Box<dyn UserData + 'static, Global>>>where
T: UserData,
Ensures the value is a UserData
of the given type T
, returning a type mismatch error
that’s not the case.
sourcepub fn is_truthy(&self) -> bool
pub fn is_truthy(&self) -> bool
Returns whether the value is truthy. All values except Nil
and False
are truthy.