Skip to main content

PairListExt

Trait PairListExt 

Source
pub(crate) trait PairListExt {
Show 14 methods // Required methods fn cons(self, cdr: SEXP) -> SEXP; fn lcons(self, cdr: SEXP) -> SEXP; fn car(&self) -> SEXP; fn cdr(&self) -> SEXP; fn tag(&self) -> SEXP; fn set_tag(&self, tag: SEXP); fn set_car(&self, value: SEXP) -> SEXP; fn set_cdr(&self, tail: SEXP) -> SEXP; unsafe fn cons_unchecked(self, cdr: SEXP) -> SEXP; unsafe fn car_unchecked(&self) -> SEXP; unsafe fn cdr_unchecked(&self) -> SEXP; unsafe fn set_tag_unchecked(&self, tag: SEXP); unsafe fn set_car_unchecked(&self, value: SEXP) -> SEXP; unsafe fn set_cdr_unchecked(&self, tail: SEXP) -> SEXP;
}
Expand description

Extension trait for SEXP providing pairlist (cons cell) operations.

Pairlist nodes have three slots: CAR (value), CDR (next), and TAG (name). This trait encapsulates the raw C functions behind method calls.

Required Methods§

Source

fn cons(self, cdr: SEXP) -> SEXP

Create a cons cell with this SEXP as CAR and cdr as CDR.

Source

fn lcons(self, cdr: SEXP) -> SEXP

Create a language cons cell with this SEXP as CAR and cdr as CDR.

Source

fn car(&self) -> SEXP

Get the CAR (head/value) of this pairlist node.

Source

fn cdr(&self) -> SEXP

Get the CDR (tail/rest) of this pairlist node.

Source

fn tag(&self) -> SEXP

Get the TAG (name symbol) of this pairlist node.

Source

fn set_tag(&self, tag: SEXP)

Set the TAG (name symbol) of this pairlist node.

Source

fn set_car(&self, value: SEXP) -> SEXP

Set the CAR (value) of this pairlist node.

Source

fn set_cdr(&self, tail: SEXP) -> SEXP

Set the CDR (tail) of this pairlist node.

Source

unsafe fn cons_unchecked(self, cdr: SEXP) -> SEXP

Create a cons cell (no thread check).

§Safety

Must be called from R’s main thread.

Source

unsafe fn car_unchecked(&self) -> SEXP

Get the CAR (no thread check).

§Safety

Must be called from R’s main thread.

Source

unsafe fn cdr_unchecked(&self) -> SEXP

Get the CDR (no thread check).

§Safety

Must be called from R’s main thread.

Source

unsafe fn set_tag_unchecked(&self, tag: SEXP)

Set the TAG (no thread check).

§Safety

Must be called from R’s main thread.

Source

unsafe fn set_car_unchecked(&self, value: SEXP) -> SEXP

Set the CAR (no thread check).

§Safety

Must be called from R’s main thread.

Source

unsafe fn set_cdr_unchecked(&self, tail: SEXP) -> SEXP

Set the CDR (no thread check).

§Safety

Must be called from R’s main thread.

Implementors§