#[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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.