#[repr(transparent)]pub struct Qundef(_);
Expand description
A placeholder value that represents an undefined value. Not exposed to Ruby level code.
See QUNDEF
to obtain a value of this type.
Implementations§
source§impl Qundef
impl Qundef
sourcepub fn from_value(val: Value) -> Option<Self>
pub fn from_value(val: Value) -> Option<Self>
Return Some(Qundef)
if val
is a Qundef
, None
otherwise.
Examples
use magnus::{eval, value::Qundef};
// nil is not undef
assert!(Qundef::from_value(eval("nil").unwrap()).is_none());
sourcepub unsafe fn to_value(self) -> Value
pub unsafe fn to_value(self) -> Value
Return self
as a Value
.
Safety
It is not a good idea to return this to Ruby code, bad things will
happen. There are only a handful of places in Ruby’s API where it is
appropriate to pass a Value
created from Qundef
(hence this
method, rather than implimenting Into<Value>
).