Trait InnerRef

Source
pub trait InnerRef {
    type Value: ReprValue;

    // Required method
    fn get_inner_ref_with<'a>(&'a self, ruby: &Ruby) -> &'a Self::Value;
}
Expand description

Helper trait for Ruby::get_inner_ref.

This trait allows for Ruby::get_inner_ref to get a reference to the inner value of both Opaque and Lazy.

Required Associated Types§

Source

type Value: ReprValue

The specific Ruby value type.

Required Methods§

Source

fn get_inner_ref_with<'a>(&'a self, ruby: &Ruby) -> &'a Self::Value

Get a reference to the inner value from self.

ruby acts as a token proving this is called from a Ruby thread and thus it is safe to access the inner value.

Implementors§

Source§

impl<T> InnerRef for Lazy<T>
where T: ReprValue,

Source§

type Value = T

Source§

impl<T> InnerRef for Opaque<T>
where T: ReprValue,

Source§

type Value = T