#[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
sourceimpl 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>
).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Qundef
impl Send for Qundef
impl Sync for Qundef
impl Unpin for Qundef
impl UnwindSafe for Qundef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more