Struct jlrs::wrappers::ptr::Ref [−][src]
#[repr(transparent)]pub struct Ref<'scope, 'data, T: Wrapper<'scope, 'data>>(_, _, _);
Expand description
An unrooted reference to Julia data.
Pointer wrappers are generally guaranteed to wrap valid, rooted data. In some cases this
guarantee is too strong. The garbage collector uses the roots as a starting point to
determine what values can be reached, as long as you can guarantee a value is reachable it’s
safe to use. Whenever data is not rooted jlrs returns a Ref
. Because it’s not rooted it’s
unsafe to use.
Implementations
An undefined reference, i.e. a null pointer.
Returns true
if the reference is undefined.
Assume the reference still points to valid Julia data and convert it to its wrapper type.
Returns None
if the reference is undefined.
Safety: a reference is only valid as long as it’s reachable through some rooted value. It’s the caller’s responsibility to ensure the result is never used after it becomes unreachable.
Assume the reference still points to valid Julia data and convert it to its wrapper type.
Safety: this method doesn’t check if the reference is undefined, a reference is only valid as long as it’s reachable through some rooted value. It’s the caller’s responsibility to ensure the result is never used after it becomes unreachable.
pub unsafe fn root<'target, 'current, S, F>(
self,
scope: S
) -> JlrsResult<S::Value> where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>,
pub unsafe fn root<'target, 'current, S, F>(
self,
scope: S
) -> JlrsResult<S::Value> where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>,
Assume the reference still points to valid Julia data and root it in scope
. Returns an
error if the reference is undefined.
Safety: a reference is only valid as long as it’s reachable through some rooted value.
Assume the reference still points to valid Julia data and convert it to a Value
. Returns
None
if the reference is undefined.
Safety: a reference is only valid as long as it’s reachable through some rooted value. It’s the caller’s responsibility to ensure the result is never used after it becomes unreachable.
Assume the reference still points to valid Julia data and convert it to a Value
.
Safety: this method doesn’t check if the reference is undefined, a reference is only valid as long as it’s reachable through some rooted value. It’s the caller’s responsibility to ensure the result is never used after it becomes unreachable.
Trait Implementations
Auto Trait Implementations
impl<'scope, 'data, T> RefUnwindSafe for Ref<'scope, 'data, T> where
<T as Wrapper<'scope, 'data>>::Wraps: RefUnwindSafe,
impl<'scope, 'data, T> UnwindSafe for Ref<'scope, 'data, T> where
<T as Wrapper<'scope, 'data>>::Wraps: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more