Skip to main content

SidecarField

Trait SidecarField 

Source
#[doc(hidden)]
pub trait SidecarField { // Required methods fn __mx_flush(&self, prot: SEXP, index: usize); fn __mx_load(&self, prot: SEXP, index: usize); fn __mx_discard_pending(&self); fn __mx_replaces_saved(&self) -> bool; }
Expand description

A Sidecar<T> field, as the handle sees it through the TypedExternal::__mx_visit_sidecars hook the derive emits. Every method runs on R’s main thread.

Required Methods§

Source

fn __mx_flush(&self, prot: SEXP, index: usize)

Moves a pending value into slot index of prot.

Source

fn __mx_load(&self, prot: SEXP, index: usize)

Reads slot index of prot back into the field as its pending value, unless one is pending already.

Source

fn __mx_discard_pending(&self)

Drops a pending value, which a write to the slot supersedes.

Source

fn __mx_replaces_saved(&self) -> bool

Whether the pending value was made by Sidecar::replace.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§