pub struct Value { /* private fields */ }
Expand description
An entry on the stack.
Implementations§
source§impl Value
impl Value
sourcepub unsafe fn from_ref<T>(data: &T) -> Result<(Self, SharedPointerGuard)>where
T: Any,
pub unsafe fn from_ref<T>(data: &T) -> Result<(Self, SharedPointerGuard)>where
T: Any,
Construct an Any that wraps a pointer.
§Safety
Caller must ensure that the returned Value
doesn’t outlive the
reference it is wrapping.
This would be an example of incorrect use:
use rune::Any;
use rune::runtime::Value;
#[derive(Any)]
struct Foo(u32);
let mut v = Foo(1u32);
unsafe {
let (any, guard) = unsafe { Value::from_ref(&v)? };
drop(v);
// any use of `any` beyond here is undefined behavior.
}
§Examples
use rune::Any;
use rune::runtime::Value;
#[derive(Any)]
struct Foo(u32);
let mut v = Foo(1u32);
unsafe {
let (any, guard) = Value::from_ref(&mut v)?;
let b = any.into_any_ref::<Foo>().unwrap();
assert_eq!(b.0, 1u32);
}
sourcepub unsafe fn from_mut<T>(data: &mut T) -> Result<(Self, SharedPointerGuard)>where
T: Any,
pub unsafe fn from_mut<T>(data: &mut T) -> Result<(Self, SharedPointerGuard)>where
T: Any,
Construct a value that wraps a mutable pointer.
§Safety
Caller must ensure that the returned Value
doesn’t outlive the
reference it is wrapping.
This would be an example of incorrect use:
use rune::Any;
use rune::runtime::Value;
#[derive(Any)]
struct Foo(u32);
let mut v = Foo(1u32);
unsafe {
let (any, guard) = Value::from_mut(&mut v)?;
drop(v);
// any use of value beyond here is undefined behavior.
}
§Examples
use rune::Any;
use rune::runtime::{Value, VmResult};
#[derive(Any)]
struct Foo(u32);
let mut v = Foo(1u32);
unsafe {
let (mut any, guard) = Value::from_mut(&mut v)?;
if let Ok(mut v) = any.into_any_mut::<Foo>() {
v.0 += 1;
}
}
assert_eq!(v.0, 2);
sourcepub fn is_writable(&self) -> bool
pub fn is_writable(&self) -> bool
Test if the value is writable.
sourcepub fn is_readable(&self) -> bool
pub fn is_readable(&self) -> bool
Test if the value is readable.
sourcepub fn snapshot(&self) -> Snapshot
pub fn snapshot(&self) -> Snapshot
Get snapshot of value.
The snapshot details how the value is currently being access.
sourcepub fn string_display(&self, f: &mut Formatter) -> VmResult<()>
pub fn string_display(&self, f: &mut Formatter) -> VmResult<()>
Format the value using the Protocol::STRING_DISPLAY protocol.
Requires a work buffer buf
which will be used in case the value
provided requires out-of-line formatting. This must be cleared between
calls and can be re-used.
You must use Vm::with to specify which virtual machine this function is called inside.
§Panics
This function will panic if called outside of a virtual machine.
sourcepub fn string_debug(&self, f: &mut Formatter) -> VmResult<()>
pub fn string_debug(&self, f: &mut Formatter) -> VmResult<()>
Debug format the value using the STRING_DEBUG
protocol.
You must use Vm::with to specify which virtual machine this function is called inside.
§Panics
This function will panic if called outside of a virtual machine.
sourcepub fn into_iter(self) -> VmResult<Iterator>
pub fn into_iter(self) -> VmResult<Iterator>
Convert value into an iterator using the Protocol::INTO_ITER
protocol.
You must use Vm::with to specify which virtual machine this function is called inside.
§Errors
This function will error if called outside of a virtual machine context.
sourcepub fn into_type_name(self) -> VmResult<String>
pub fn into_type_name(self) -> VmResult<String>
Retrieves a human readable type name for the current value.
You must use Vm::with to specify which virtual machine this function is called inside.
§Errors
This function errors in case the provided type cannot be converted into
a name without the use of a Vm
and one is not provided through the
environment.
sourcepub fn empty_struct(rtti: Arc<Rtti>) -> VmResult<Self>
pub fn empty_struct(rtti: Arc<Rtti>) -> VmResult<Self>
Construct an empty.
sourcepub fn tuple_struct(rtti: Arc<Rtti>, vec: Vec<Value>) -> VmResult<Self>
pub fn tuple_struct(rtti: Arc<Rtti>, vec: Vec<Value>) -> VmResult<Self>
Construct a typed tuple.
sourcepub fn unit_variant(rtti: Arc<VariantRtti>) -> VmResult<Self>
pub fn unit_variant(rtti: Arc<VariantRtti>) -> VmResult<Self>
Construct an empty variant.
sourcepub fn tuple_variant(rtti: Arc<VariantRtti>, vec: Vec<Value>) -> VmResult<Self>
pub fn tuple_variant(rtti: Arc<VariantRtti>, vec: Vec<Value>) -> VmResult<Self>
Construct a tuple variant.
sourcepub fn as_usize(&self) -> Result<usize, RuntimeError>
pub fn as_usize(&self) -> Result<usize, RuntimeError>
Try to coerce value into a usize.
sourcepub fn as_string(&self) -> Result<BorrowRef<'_, str>, RuntimeError>
👎Deprecated: For consistency with other methods, this has been renamed Value::borrow_string_ref
pub fn as_string(&self) -> Result<BorrowRef<'_, str>, RuntimeError>
Get the value as a string.
sourcepub fn borrow_string_ref(&self) -> Result<BorrowRef<'_, str>, RuntimeError>
pub fn borrow_string_ref(&self) -> Result<BorrowRef<'_, str>, RuntimeError>
Borrow the value of a string as a reference.
sourcepub fn into_string(self) -> Result<String, RuntimeError>
pub fn into_string(self) -> Result<String, RuntimeError>
Take the current value as a string.
sourcepub fn into_unit(&self) -> Result<(), RuntimeError>
pub fn into_unit(&self) -> Result<(), RuntimeError>
Coerce into a unit.
sourcepub fn into_ordering_ref(self) -> Result<Ref<Ordering>, RuntimeError>
pub fn into_ordering_ref(self) -> Result<Ref<Ordering>, RuntimeError>
Coerce into Ordering
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_ordering_mut(self) -> Result<Mut<Ordering>, RuntimeError>
pub fn into_ordering_mut(self) -> Result<Mut<Ordering>, RuntimeError>
Coerce into Ordering
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_ordering_ref(
&self
) -> Result<BorrowRef<'_, Ordering>, RuntimeError>
pub fn borrow_ordering_ref( &self ) -> Result<BorrowRef<'_, Ordering>, RuntimeError>
Coerce into Ordering
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_ordering_mut(
&self
) -> Result<BorrowMut<'_, Ordering>, RuntimeError>
pub fn borrow_ordering_mut( &self ) -> Result<BorrowMut<'_, Ordering>, RuntimeError>
Coerce into Ordering
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_ordering(&self) -> Result<Ordering, RuntimeError>
pub fn as_ordering(&self) -> Result<Ordering, RuntimeError>
Coerce into Ordering
.
This copied the underlying value.
sourcepub fn into_bool_ref(self) -> Result<Ref<bool>, RuntimeError>
pub fn into_bool_ref(self) -> Result<Ref<bool>, RuntimeError>
Coerce into bool
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_bool_mut(self) -> Result<Mut<bool>, RuntimeError>
pub fn into_bool_mut(self) -> Result<Mut<bool>, RuntimeError>
Coerce into bool
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_bool_ref(&self) -> Result<BorrowRef<'_, bool>, RuntimeError>
pub fn borrow_bool_ref(&self) -> Result<BorrowRef<'_, bool>, RuntimeError>
Coerce into bool
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_bool_mut(&self) -> Result<BorrowMut<'_, bool>, RuntimeError>
pub fn borrow_bool_mut(&self) -> Result<BorrowMut<'_, bool>, RuntimeError>
Coerce into bool
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_bool(&self) -> Result<bool, RuntimeError>
pub fn as_bool(&self) -> Result<bool, RuntimeError>
Coerce into bool
.
This copied the underlying value.
sourcepub fn into_byte_ref(self) -> Result<Ref<u8>, RuntimeError>
pub fn into_byte_ref(self) -> Result<Ref<u8>, RuntimeError>
Coerce into u8
byte.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_byte_mut(self) -> Result<Mut<u8>, RuntimeError>
pub fn into_byte_mut(self) -> Result<Mut<u8>, RuntimeError>
Coerce into u8
byte.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_byte_ref(&self) -> Result<BorrowRef<'_, u8>, RuntimeError>
pub fn borrow_byte_ref(&self) -> Result<BorrowRef<'_, u8>, RuntimeError>
Coerce into u8
byte.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_byte_mut(&self) -> Result<BorrowMut<'_, u8>, RuntimeError>
pub fn borrow_byte_mut(&self) -> Result<BorrowMut<'_, u8>, RuntimeError>
Coerce into u8
byte.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_byte(&self) -> Result<u8, RuntimeError>
pub fn as_byte(&self) -> Result<u8, RuntimeError>
Coerce into u8
byte.
This copied the underlying value.
sourcepub fn into_char_ref(self) -> Result<Ref<char>, RuntimeError>
pub fn into_char_ref(self) -> Result<Ref<char>, RuntimeError>
Coerce into char
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_char_mut(self) -> Result<Mut<char>, RuntimeError>
pub fn into_char_mut(self) -> Result<Mut<char>, RuntimeError>
Coerce into char
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_char_ref(&self) -> Result<BorrowRef<'_, char>, RuntimeError>
pub fn borrow_char_ref(&self) -> Result<BorrowRef<'_, char>, RuntimeError>
Coerce into char
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_char_mut(&self) -> Result<BorrowMut<'_, char>, RuntimeError>
pub fn borrow_char_mut(&self) -> Result<BorrowMut<'_, char>, RuntimeError>
Coerce into char
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_char(&self) -> Result<char, RuntimeError>
pub fn as_char(&self) -> Result<char, RuntimeError>
Coerce into char
.
This copied the underlying value.
sourcepub fn into_integer_ref(self) -> Result<Ref<i64>, RuntimeError>
pub fn into_integer_ref(self) -> Result<Ref<i64>, RuntimeError>
Coerce into i64
integer.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_integer_mut(self) -> Result<Mut<i64>, RuntimeError>
pub fn into_integer_mut(self) -> Result<Mut<i64>, RuntimeError>
Coerce into i64
integer.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_integer_ref(&self) -> Result<BorrowRef<'_, i64>, RuntimeError>
pub fn borrow_integer_ref(&self) -> Result<BorrowRef<'_, i64>, RuntimeError>
Coerce into i64
integer.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_integer_mut(&self) -> Result<BorrowMut<'_, i64>, RuntimeError>
pub fn borrow_integer_mut(&self) -> Result<BorrowMut<'_, i64>, RuntimeError>
Coerce into i64
integer.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_integer(&self) -> Result<i64, RuntimeError>
pub fn as_integer(&self) -> Result<i64, RuntimeError>
Coerce into i64
integer.
This copied the underlying value.
sourcepub fn into_float_ref(self) -> Result<Ref<f64>, RuntimeError>
pub fn into_float_ref(self) -> Result<Ref<f64>, RuntimeError>
Coerce into f64
float.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_float_mut(self) -> Result<Mut<f64>, RuntimeError>
pub fn into_float_mut(self) -> Result<Mut<f64>, RuntimeError>
Coerce into f64
float.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_float_ref(&self) -> Result<BorrowRef<'_, f64>, RuntimeError>
pub fn borrow_float_ref(&self) -> Result<BorrowRef<'_, f64>, RuntimeError>
Coerce into f64
float.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_float_mut(&self) -> Result<BorrowMut<'_, f64>, RuntimeError>
pub fn borrow_float_mut(&self) -> Result<BorrowMut<'_, f64>, RuntimeError>
Coerce into f64
float.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_float(&self) -> Result<f64, RuntimeError>
pub fn as_float(&self) -> Result<f64, RuntimeError>
Coerce into f64
float.
This copied the underlying value.
sourcepub fn into_type_ref(self) -> Result<Ref<Type>, RuntimeError>
pub fn into_type_ref(self) -> Result<Ref<Type>, RuntimeError>
Coerce into Type
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_type_mut(self) -> Result<Mut<Type>, RuntimeError>
pub fn into_type_mut(self) -> Result<Mut<Type>, RuntimeError>
Coerce into Type
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_type_ref(&self) -> Result<BorrowRef<'_, Type>, RuntimeError>
pub fn borrow_type_ref(&self) -> Result<BorrowRef<'_, Type>, RuntimeError>
Coerce into Type
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_type_mut(&self) -> Result<BorrowMut<'_, Type>, RuntimeError>
pub fn borrow_type_mut(&self) -> Result<BorrowMut<'_, Type>, RuntimeError>
Coerce into Type
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_type(&self) -> Result<Type, RuntimeError>
pub fn as_type(&self) -> Result<Type, RuntimeError>
Coerce into Type
.
This copied the underlying value.
sourcepub fn into_option_ref(self) -> Result<Ref<Option<Value>>, RuntimeError>
pub fn into_option_ref(self) -> Result<Ref<Option<Value>>, RuntimeError>
Coerce into Option
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_option_mut(self) -> Result<Mut<Option<Value>>, RuntimeError>
pub fn into_option_mut(self) -> Result<Mut<Option<Value>>, RuntimeError>
Coerce into Option
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_option_ref(
&self
) -> Result<BorrowRef<'_, Option<Value>>, RuntimeError>
pub fn borrow_option_ref( &self ) -> Result<BorrowRef<'_, Option<Value>>, RuntimeError>
Coerce into Option
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_option_mut(
&self
) -> Result<BorrowMut<'_, Option<Value>>, RuntimeError>
pub fn borrow_option_mut( &self ) -> Result<BorrowMut<'_, Option<Value>>, RuntimeError>
Coerce into Option
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_option(&self) -> Result<Option<Value>, RuntimeError>
pub fn as_option(&self) -> Result<Option<Value>, RuntimeError>
Coerce into Option
.
This clones the underlying value.
sourcepub fn into_result_ref(self) -> Result<Ref<Result<Value, Value>>, RuntimeError>
pub fn into_result_ref(self) -> Result<Ref<Result<Value, Value>>, RuntimeError>
Coerce into Result
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_result_mut(self) -> Result<Mut<Result<Value, Value>>, RuntimeError>
pub fn into_result_mut(self) -> Result<Mut<Result<Value, Value>>, RuntimeError>
Coerce into Result
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_result_ref(
&self
) -> Result<BorrowRef<'_, Result<Value, Value>>, RuntimeError>
pub fn borrow_result_ref( &self ) -> Result<BorrowRef<'_, Result<Value, Value>>, RuntimeError>
Coerce into Result
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_result_mut(
&self
) -> Result<BorrowMut<'_, Result<Value, Value>>, RuntimeError>
pub fn borrow_result_mut( &self ) -> Result<BorrowMut<'_, Result<Value, Value>>, RuntimeError>
Coerce into Result
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn as_result(&self) -> Result<Result<Value, Value>, RuntimeError>
pub fn as_result(&self) -> Result<Result<Value, Value>, RuntimeError>
Coerce into Result
.
This clones the underlying value.
sourcepub fn into_vec_ref(self) -> Result<Ref<Vec>, RuntimeError>
pub fn into_vec_ref(self) -> Result<Ref<Vec>, RuntimeError>
Coerce into Vec
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_vec_mut(self) -> Result<Mut<Vec>, RuntimeError>
pub fn into_vec_mut(self) -> Result<Mut<Vec>, RuntimeError>
Coerce into Vec
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_vec_ref(&self) -> Result<BorrowRef<'_, Vec>, RuntimeError>
pub fn borrow_vec_ref(&self) -> Result<BorrowRef<'_, Vec>, RuntimeError>
Coerce into Vec
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_vec_mut(&self) -> Result<BorrowMut<'_, Vec>, RuntimeError>
pub fn borrow_vec_mut(&self) -> Result<BorrowMut<'_, Vec>, RuntimeError>
Coerce into Vec
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_vec(self) -> Result<Vec, RuntimeError>
pub fn into_vec(self) -> Result<Vec, RuntimeError>
Coerce into Vec
.
This consumes the underlying value.
sourcepub fn into_bytes_ref(self) -> Result<Ref<Bytes>, RuntimeError>
pub fn into_bytes_ref(self) -> Result<Ref<Bytes>, RuntimeError>
Coerce into Bytes
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_bytes_mut(self) -> Result<Mut<Bytes>, RuntimeError>
pub fn into_bytes_mut(self) -> Result<Mut<Bytes>, RuntimeError>
Coerce into Bytes
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_bytes_ref(&self) -> Result<BorrowRef<'_, Bytes>, RuntimeError>
pub fn borrow_bytes_ref(&self) -> Result<BorrowRef<'_, Bytes>, RuntimeError>
Coerce into Bytes
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_bytes_mut(&self) -> Result<BorrowMut<'_, Bytes>, RuntimeError>
pub fn borrow_bytes_mut(&self) -> Result<BorrowMut<'_, Bytes>, RuntimeError>
Coerce into Bytes
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_bytes(self) -> Result<Bytes, RuntimeError>
pub fn into_bytes(self) -> Result<Bytes, RuntimeError>
Coerce into Bytes
.
This consumes the underlying value.
sourcepub fn into_control_flow_ref(self) -> Result<Ref<ControlFlow>, RuntimeError>
pub fn into_control_flow_ref(self) -> Result<Ref<ControlFlow>, RuntimeError>
Coerce into a ControlFlow
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_control_flow_mut(self) -> Result<Mut<ControlFlow>, RuntimeError>
pub fn into_control_flow_mut(self) -> Result<Mut<ControlFlow>, RuntimeError>
Coerce into a ControlFlow
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_control_flow_ref(
&self
) -> Result<BorrowRef<'_, ControlFlow>, RuntimeError>
pub fn borrow_control_flow_ref( &self ) -> Result<BorrowRef<'_, ControlFlow>, RuntimeError>
Coerce into a ControlFlow
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_control_flow_mut(
&self
) -> Result<BorrowMut<'_, ControlFlow>, RuntimeError>
pub fn borrow_control_flow_mut( &self ) -> Result<BorrowMut<'_, ControlFlow>, RuntimeError>
Coerce into a ControlFlow
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_control_flow(self) -> Result<ControlFlow, RuntimeError>
pub fn into_control_flow(self) -> Result<ControlFlow, RuntimeError>
Coerce into a ControlFlow
.
This consumes the underlying value.
sourcepub fn into_function_ref(self) -> Result<Ref<Function>, RuntimeError>
pub fn into_function_ref(self) -> Result<Ref<Function>, RuntimeError>
Coerce into a Function
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_function_mut(self) -> Result<Mut<Function>, RuntimeError>
pub fn into_function_mut(self) -> Result<Mut<Function>, RuntimeError>
Coerce into a Function
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_function_ref(
&self
) -> Result<BorrowRef<'_, Function>, RuntimeError>
pub fn borrow_function_ref( &self ) -> Result<BorrowRef<'_, Function>, RuntimeError>
Coerce into a Function
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_function_mut(
&self
) -> Result<BorrowMut<'_, Function>, RuntimeError>
pub fn borrow_function_mut( &self ) -> Result<BorrowMut<'_, Function>, RuntimeError>
Coerce into a Function
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_function(self) -> Result<Function, RuntimeError>
pub fn into_function(self) -> Result<Function, RuntimeError>
Coerce into a Function
.
This consumes the underlying value.
sourcepub fn into_generator_state_ref(
self
) -> Result<Ref<GeneratorState>, RuntimeError>
pub fn into_generator_state_ref( self ) -> Result<Ref<GeneratorState>, RuntimeError>
Coerce into a GeneratorState
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_generator_state_mut(
self
) -> Result<Mut<GeneratorState>, RuntimeError>
pub fn into_generator_state_mut( self ) -> Result<Mut<GeneratorState>, RuntimeError>
Coerce into a GeneratorState
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_generator_state_ref(
&self
) -> Result<BorrowRef<'_, GeneratorState>, RuntimeError>
pub fn borrow_generator_state_ref( &self ) -> Result<BorrowRef<'_, GeneratorState>, RuntimeError>
Coerce into a GeneratorState
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_generator_state_mut(
&self
) -> Result<BorrowMut<'_, GeneratorState>, RuntimeError>
pub fn borrow_generator_state_mut( &self ) -> Result<BorrowMut<'_, GeneratorState>, RuntimeError>
Coerce into a GeneratorState
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_generator_state(self) -> Result<GeneratorState, RuntimeError>
pub fn into_generator_state(self) -> Result<GeneratorState, RuntimeError>
Coerce into a GeneratorState
.
This consumes the underlying value.
sourcepub fn into_generator_ref(self) -> Result<Ref<Generator<Vm>>, RuntimeError>
pub fn into_generator_ref(self) -> Result<Ref<Generator<Vm>>, RuntimeError>
Coerce into a Generator
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_generator_mut(self) -> Result<Mut<Generator<Vm>>, RuntimeError>
pub fn into_generator_mut(self) -> Result<Mut<Generator<Vm>>, RuntimeError>
Coerce into a Generator
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_generator_ref(
&self
) -> Result<BorrowRef<'_, Generator<Vm>>, RuntimeError>
pub fn borrow_generator_ref( &self ) -> Result<BorrowRef<'_, Generator<Vm>>, RuntimeError>
Coerce into a Generator
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_generator_mut(
&self
) -> Result<BorrowMut<'_, Generator<Vm>>, RuntimeError>
pub fn borrow_generator_mut( &self ) -> Result<BorrowMut<'_, Generator<Vm>>, RuntimeError>
Coerce into a Generator
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_generator(self) -> Result<Generator<Vm>, RuntimeError>
pub fn into_generator(self) -> Result<Generator<Vm>, RuntimeError>
Coerce into a Generator
.
This consumes the underlying value.
sourcepub fn into_iterator_ref(self) -> Result<Ref<Iterator>, RuntimeError>
pub fn into_iterator_ref(self) -> Result<Ref<Iterator>, RuntimeError>
Coerce into a Iterator
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_iterator_mut(self) -> Result<Mut<Iterator>, RuntimeError>
pub fn into_iterator_mut(self) -> Result<Mut<Iterator>, RuntimeError>
Coerce into a Iterator
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_iterator_ref(
&self
) -> Result<BorrowRef<'_, Iterator>, RuntimeError>
pub fn borrow_iterator_ref( &self ) -> Result<BorrowRef<'_, Iterator>, RuntimeError>
Coerce into a Iterator
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_iterator_mut(
&self
) -> Result<BorrowMut<'_, Iterator>, RuntimeError>
pub fn borrow_iterator_mut( &self ) -> Result<BorrowMut<'_, Iterator>, RuntimeError>
Coerce into a Iterator
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_iterator(self) -> Result<Iterator, RuntimeError>
pub fn into_iterator(self) -> Result<Iterator, RuntimeError>
Coerce into a Iterator
.
This consumes the underlying value.
sourcepub fn into_format_ref(self) -> Result<Ref<Format>, RuntimeError>
pub fn into_format_ref(self) -> Result<Ref<Format>, RuntimeError>
Coerce into a Format
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_format_mut(self) -> Result<Mut<Format>, RuntimeError>
pub fn into_format_mut(self) -> Result<Mut<Format>, RuntimeError>
Coerce into a Format
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_format_ref(&self) -> Result<BorrowRef<'_, Format>, RuntimeError>
pub fn borrow_format_ref(&self) -> Result<BorrowRef<'_, Format>, RuntimeError>
Coerce into a Format
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_format_mut(&self) -> Result<BorrowMut<'_, Format>, RuntimeError>
pub fn borrow_format_mut(&self) -> Result<BorrowMut<'_, Format>, RuntimeError>
Coerce into a Format
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_format(self) -> Result<Format, RuntimeError>
pub fn into_format(self) -> Result<Format, RuntimeError>
Coerce into a Format
.
This consumes the underlying value.
sourcepub fn into_tuple_ref(self) -> Result<Ref<OwnedTuple>, RuntimeError>
pub fn into_tuple_ref(self) -> Result<Ref<OwnedTuple>, RuntimeError>
Coerce into Tuple
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_tuple_mut(self) -> Result<Mut<OwnedTuple>, RuntimeError>
pub fn into_tuple_mut(self) -> Result<Mut<OwnedTuple>, RuntimeError>
Coerce into Tuple
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_tuple_ref(
&self
) -> Result<BorrowRef<'_, OwnedTuple>, RuntimeError>
pub fn borrow_tuple_ref( &self ) -> Result<BorrowRef<'_, OwnedTuple>, RuntimeError>
Coerce into Tuple
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_tuple_mut(
&self
) -> Result<BorrowMut<'_, OwnedTuple>, RuntimeError>
pub fn borrow_tuple_mut( &self ) -> Result<BorrowMut<'_, OwnedTuple>, RuntimeError>
Coerce into Tuple
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_tuple(self) -> Result<OwnedTuple, RuntimeError>
pub fn into_tuple(self) -> Result<OwnedTuple, RuntimeError>
Coerce into Tuple
.
This consumes the underlying value.
sourcepub fn into_struct_ref(self) -> Result<Ref<Struct>, RuntimeError>
pub fn into_struct_ref(self) -> Result<Ref<Struct>, RuntimeError>
Coerce into Struct
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_struct_mut(self) -> Result<Mut<Struct>, RuntimeError>
pub fn into_struct_mut(self) -> Result<Mut<Struct>, RuntimeError>
Coerce into Struct
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_struct_ref(&self) -> Result<BorrowRef<'_, Struct>, RuntimeError>
pub fn borrow_struct_ref(&self) -> Result<BorrowRef<'_, Struct>, RuntimeError>
Coerce into Struct
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_struct_mut(&self) -> Result<BorrowMut<'_, Struct>, RuntimeError>
pub fn borrow_struct_mut(&self) -> Result<BorrowMut<'_, Struct>, RuntimeError>
Coerce into Struct
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_struct(self) -> Result<Struct, RuntimeError>
pub fn into_struct(self) -> Result<Struct, RuntimeError>
Coerce into Struct
This consumes the underlying value.
sourcepub fn into_object_ref(self) -> Result<Ref<Object>, RuntimeError>
pub fn into_object_ref(self) -> Result<Ref<Object>, RuntimeError>
Coerce into a Object
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_object_mut(self) -> Result<Mut<Object>, RuntimeError>
pub fn into_object_mut(self) -> Result<Mut<Object>, RuntimeError>
Coerce into a Object
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_object_ref(&self) -> Result<BorrowRef<'_, Object>, RuntimeError>
pub fn borrow_object_ref(&self) -> Result<BorrowRef<'_, Object>, RuntimeError>
Coerce into a Object
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_object_mut(&self) -> Result<BorrowMut<'_, Object>, RuntimeError>
pub fn borrow_object_mut(&self) -> Result<BorrowMut<'_, Object>, RuntimeError>
Coerce into a Object
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_object(self) -> Result<Object, RuntimeError>
pub fn into_object(self) -> Result<Object, RuntimeError>
Coerce into a Object
.
This consumes the underlying value.
sourcepub fn into_range_from_ref(self) -> Result<Ref<RangeFrom>, RuntimeError>
pub fn into_range_from_ref(self) -> Result<Ref<RangeFrom>, RuntimeError>
Coerce into a RangeFrom
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_range_from_mut(self) -> Result<Mut<RangeFrom>, RuntimeError>
pub fn into_range_from_mut(self) -> Result<Mut<RangeFrom>, RuntimeError>
Coerce into a RangeFrom
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_range_from_ref(
&self
) -> Result<BorrowRef<'_, RangeFrom>, RuntimeError>
pub fn borrow_range_from_ref( &self ) -> Result<BorrowRef<'_, RangeFrom>, RuntimeError>
Coerce into a RangeFrom
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_range_from_mut(
&self
) -> Result<BorrowMut<'_, RangeFrom>, RuntimeError>
pub fn borrow_range_from_mut( &self ) -> Result<BorrowMut<'_, RangeFrom>, RuntimeError>
Coerce into a RangeFrom
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_range_from(self) -> Result<RangeFrom, RuntimeError>
pub fn into_range_from(self) -> Result<RangeFrom, RuntimeError>
Coerce into a RangeFrom
.
This consumes the underlying value.
sourcepub fn into_range_full_ref(self) -> Result<Ref<RangeFull>, RuntimeError>
pub fn into_range_full_ref(self) -> Result<Ref<RangeFull>, RuntimeError>
Coerce into a RangeFull
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_range_full_mut(self) -> Result<Mut<RangeFull>, RuntimeError>
pub fn into_range_full_mut(self) -> Result<Mut<RangeFull>, RuntimeError>
Coerce into a RangeFull
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_range_full_ref(
&self
) -> Result<BorrowRef<'_, RangeFull>, RuntimeError>
pub fn borrow_range_full_ref( &self ) -> Result<BorrowRef<'_, RangeFull>, RuntimeError>
Coerce into a RangeFull
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_range_full_mut(
&self
) -> Result<BorrowMut<'_, RangeFull>, RuntimeError>
pub fn borrow_range_full_mut( &self ) -> Result<BorrowMut<'_, RangeFull>, RuntimeError>
Coerce into a RangeFull
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_range_full(self) -> Result<RangeFull, RuntimeError>
pub fn into_range_full(self) -> Result<RangeFull, RuntimeError>
Coerce into a RangeFull
.
This consumes the underlying value.
sourcepub fn into_range_to_inclusive_ref(
self
) -> Result<Ref<RangeToInclusive>, RuntimeError>
pub fn into_range_to_inclusive_ref( self ) -> Result<Ref<RangeToInclusive>, RuntimeError>
Coerce into a RangeToInclusive
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_range_to_inclusive_mut(
self
) -> Result<Mut<RangeToInclusive>, RuntimeError>
pub fn into_range_to_inclusive_mut( self ) -> Result<Mut<RangeToInclusive>, RuntimeError>
Coerce into a RangeToInclusive
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_range_to_inclusive_ref(
&self
) -> Result<BorrowRef<'_, RangeToInclusive>, RuntimeError>
pub fn borrow_range_to_inclusive_ref( &self ) -> Result<BorrowRef<'_, RangeToInclusive>, RuntimeError>
Coerce into a RangeToInclusive
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_range_to_inclusive_mut(
&self
) -> Result<BorrowMut<'_, RangeToInclusive>, RuntimeError>
pub fn borrow_range_to_inclusive_mut( &self ) -> Result<BorrowMut<'_, RangeToInclusive>, RuntimeError>
Coerce into a RangeToInclusive
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_range_to_inclusive(self) -> Result<RangeToInclusive, RuntimeError>
pub fn into_range_to_inclusive(self) -> Result<RangeToInclusive, RuntimeError>
Coerce into a RangeToInclusive
.
This consumes the underlying value.
sourcepub fn into_range_inclusive_ref(
self
) -> Result<Ref<RangeInclusive>, RuntimeError>
pub fn into_range_inclusive_ref( self ) -> Result<Ref<RangeInclusive>, RuntimeError>
Coerce into a RangeInclusive
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_range_inclusive_mut(
self
) -> Result<Mut<RangeInclusive>, RuntimeError>
pub fn into_range_inclusive_mut( self ) -> Result<Mut<RangeInclusive>, RuntimeError>
Coerce into a RangeInclusive
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_range_inclusive_ref(
&self
) -> Result<BorrowRef<'_, RangeInclusive>, RuntimeError>
pub fn borrow_range_inclusive_ref( &self ) -> Result<BorrowRef<'_, RangeInclusive>, RuntimeError>
Coerce into a RangeInclusive
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_range_inclusive_mut(
&self
) -> Result<BorrowMut<'_, RangeInclusive>, RuntimeError>
pub fn borrow_range_inclusive_mut( &self ) -> Result<BorrowMut<'_, RangeInclusive>, RuntimeError>
Coerce into a RangeInclusive
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_range_inclusive(self) -> Result<RangeInclusive, RuntimeError>
pub fn into_range_inclusive(self) -> Result<RangeInclusive, RuntimeError>
Coerce into a RangeInclusive
.
This consumes the underlying value.
sourcepub fn into_range_to_ref(self) -> Result<Ref<RangeTo>, RuntimeError>
pub fn into_range_to_ref(self) -> Result<Ref<RangeTo>, RuntimeError>
Coerce into a RangeTo
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_range_to_mut(self) -> Result<Mut<RangeTo>, RuntimeError>
pub fn into_range_to_mut(self) -> Result<Mut<RangeTo>, RuntimeError>
Coerce into a RangeTo
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_range_to_ref(
&self
) -> Result<BorrowRef<'_, RangeTo>, RuntimeError>
pub fn borrow_range_to_ref( &self ) -> Result<BorrowRef<'_, RangeTo>, RuntimeError>
Coerce into a RangeTo
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_range_to_mut(
&self
) -> Result<BorrowMut<'_, RangeTo>, RuntimeError>
pub fn borrow_range_to_mut( &self ) -> Result<BorrowMut<'_, RangeTo>, RuntimeError>
Coerce into a RangeTo
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_range_to(self) -> Result<RangeTo, RuntimeError>
pub fn into_range_to(self) -> Result<RangeTo, RuntimeError>
Coerce into a RangeTo
.
This consumes the underlying value.
sourcepub fn into_range_ref(self) -> Result<Ref<Range>, RuntimeError>
pub fn into_range_ref(self) -> Result<Ref<Range>, RuntimeError>
Coerce into a Range
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_range_mut(self) -> Result<Mut<Range>, RuntimeError>
pub fn into_range_mut(self) -> Result<Mut<Range>, RuntimeError>
Coerce into a Range
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_range_ref(&self) -> Result<BorrowRef<'_, Range>, RuntimeError>
pub fn borrow_range_ref(&self) -> Result<BorrowRef<'_, Range>, RuntimeError>
Coerce into a Range
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_range_mut(&self) -> Result<BorrowMut<'_, Range>, RuntimeError>
pub fn borrow_range_mut(&self) -> Result<BorrowMut<'_, Range>, RuntimeError>
Coerce into a Range
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_range(self) -> Result<Range, RuntimeError>
pub fn into_range(self) -> Result<Range, RuntimeError>
Coerce into a Range
.
This consumes the underlying value.
sourcepub fn into_stream_ref(self) -> Result<Ref<Stream<Vm>>, RuntimeError>
pub fn into_stream_ref(self) -> Result<Ref<Stream<Vm>>, RuntimeError>
Coerce into a Stream
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_stream_mut(self) -> Result<Mut<Stream<Vm>>, RuntimeError>
pub fn into_stream_mut(self) -> Result<Mut<Stream<Vm>>, RuntimeError>
Coerce into a Stream
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_stream_ref(
&self
) -> Result<BorrowRef<'_, Stream<Vm>>, RuntimeError>
pub fn borrow_stream_ref( &self ) -> Result<BorrowRef<'_, Stream<Vm>>, RuntimeError>
Coerce into a Stream
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_stream_mut(
&self
) -> Result<BorrowMut<'_, Stream<Vm>>, RuntimeError>
pub fn borrow_stream_mut( &self ) -> Result<BorrowMut<'_, Stream<Vm>>, RuntimeError>
Coerce into a Stream
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_stream(self) -> Result<Stream<Vm>, RuntimeError>
pub fn into_stream(self) -> Result<Stream<Vm>, RuntimeError>
Coerce into a Stream
.
This consumes the underlying value.
sourcepub fn into_future_ref(self) -> Result<Ref<Future>, RuntimeError>
pub fn into_future_ref(self) -> Result<Ref<Future>, RuntimeError>
Coerce into a Future
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn into_future_mut(self) -> Result<Mut<Future>, RuntimeError>
pub fn into_future_mut(self) -> Result<Mut<Future>, RuntimeError>
Coerce into a Future
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn borrow_future_ref(&self) -> Result<BorrowRef<'_, Future>, RuntimeError>
pub fn borrow_future_ref(&self) -> Result<BorrowRef<'_, Future>, RuntimeError>
Coerce into a Future
.
This ensures that the value has read access to the underlying value and does not consume it.
sourcepub fn borrow_future_mut(&self) -> Result<BorrowMut<'_, Future>, RuntimeError>
pub fn borrow_future_mut(&self) -> Result<BorrowMut<'_, Future>, RuntimeError>
Coerce into a Future
.
This ensures that the value has write access to the underlying value and does not consume it.
sourcepub fn into_any_obj(self) -> Result<AnyObj, RuntimeError>
pub fn into_any_obj(self) -> Result<AnyObj, RuntimeError>
Coerce into an AnyObj
.
This consumes the underlying value.
sourcepub fn into_future(self) -> VmResult<Future>
pub fn into_future(self) -> VmResult<Future>
Coerce into a future, or convert into a future using the Protocol::INTO_FUTURE protocol.
You must use Vm::with to specify which virtual machine this function is called inside.
§Errors
This function errors in case the provided type cannot be converted into
a future without the use of a Vm
and one is not provided through the
environment.
sourcepub fn into_any_ref<T>(self) -> Result<Ref<T>, RuntimeError>where
T: Any,
pub fn into_any_ref<T>(self) -> Result<Ref<T>, RuntimeError>where
T: Any,
Try to coerce value into a typed reference.
sourcepub fn into_any_mut<T>(self) -> Result<Mut<T>, RuntimeError>where
T: Any,
pub fn into_any_mut<T>(self) -> Result<Mut<T>, RuntimeError>where
T: Any,
Try to coerce value into a typed mutable reference.
sourcepub fn borrow_any_ref<T>(&self) -> Result<BorrowRef<'_, T>, RuntimeError>where
T: Any,
pub fn borrow_any_ref<T>(&self) -> Result<BorrowRef<'_, T>, RuntimeError>where
T: Any,
Borrow the value as a typed reference.
sourcepub fn borrow_any_mut<T>(&self) -> Result<BorrowMut<'_, T>, RuntimeError>where
T: Any,
pub fn borrow_any_mut<T>(&self) -> Result<BorrowMut<'_, T>, RuntimeError>where
T: Any,
Borrow the value as a mutable typed reference.
sourcepub fn into_any<T>(self) -> Result<T, RuntimeError>where
T: Any,
pub fn into_any<T>(self) -> Result<T, RuntimeError>where
T: Any,
Try to coerce value into a typed value.
sourcepub fn type_hash(&self) -> Result<Hash, AccessError>
pub fn type_hash(&self) -> Result<Hash, AccessError>
Get the type hash for the current value.
One notable feature is that the type of a variant is its container enum, and not the type hash of the variant itself.
sourcepub fn type_info(&self) -> Result<TypeInfo, AccessError>
pub fn type_info(&self) -> Result<TypeInfo, AccessError>
Get the type information for the current value.
sourcepub fn partial_eq(a: &Value, b: &Value) -> VmResult<bool>
pub fn partial_eq(a: &Value, b: &Value) -> VmResult<bool>
Perform a partial equality test between two values.
This is the basis for the eq operation (partial_eq
/ ‘==’).
External types will use the Protocol::PARTIAL_EQ
protocol when
invoked through this function.
§Errors
This function will error if called outside of a virtual machine context.
sourcepub fn eq(&self, b: &Value) -> VmResult<bool>
pub fn eq(&self, b: &Value) -> VmResult<bool>
Perform a total equality test between two values.
This is the basis for the eq operation (==
).
External types will use the Protocol::EQ
protocol when invoked
through this function.
§Errors
This function will error if called outside of a virtual machine context.
sourcepub fn partial_cmp(a: &Value, b: &Value) -> VmResult<Option<Ordering>>
pub fn partial_cmp(a: &Value, b: &Value) -> VmResult<Option<Ordering>>
Perform a partial ordering comparison between two values.
This is the basis for the comparison operation.
External types will use the Protocol::PARTIAL_CMP
protocol when
invoked through this function.
§Errors
This function will error if called outside of a virtual machine context.
sourcepub fn cmp(a: &Value, b: &Value) -> VmResult<Ordering>
pub fn cmp(a: &Value, b: &Value) -> VmResult<Ordering>
Perform a total ordering comparison between two values.
This is the basis for the comparison operation (cmp
).
External types will use the Protocol::CMP
protocol when invoked
through this function.
§Errors
This function will error if called outside of a virtual machine context.
sourcepub fn try_as_integer<T>(&self) -> Result<T, RuntimeError>
pub fn try_as_integer<T>(&self) -> Result<T, RuntimeError>
Try to coerce the current value as the specified integer T
.
§Examples
use rune::runtime::{Value, VmResult};
let value = rune::to_value(u32::MAX)?;
assert_eq!(value.try_as_integer::<u64>(), Ok(u32::MAX as u64));
assert!(value.try_as_integer::<i32>().is_err());
Trait Implementations§
source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Deserialize implementation for value pointers.