Skip to main content

Module rooted

Module rooted 

Source
Expand description

Conversions whose borrowed result cannot outlive an R root.

Re-exportsΒ§

use super::NativeBorrow; πŸ”’
use super::SexpError; πŸ”’
use super::SexpTypeError; πŸ”’
use super::TryFromSexp; πŸ”’
use super::map_strsxp_with; πŸ”’
use super::map_vecsxp_batched; πŸ”’
use super::try_charsxp_to_cow; πŸ”’
use super::try_charsxp_to_str; πŸ”’
use crate::RCow; πŸ”’
use crate::RNativeType; πŸ”’
use crate::RNativeType; πŸ”’
use crate::Root; πŸ”’
use crate::SEXP; πŸ”’
use crate::SEXPTYPE; πŸ”’
use crate::SexpExt; πŸ”’
use crate::StrVec; πŸ”’
use std::borrow::Cow; πŸ”’

MacrosΒ§

character_elements πŸ”’
Character elements keep the raw conversions’ NA handling: NA reads as "" for the plain forms and as None for the optional ones. $borrow reads one non-NA element and may refuse it (a string marked as bytes); the walk reports every refused element in one error.
list_elements πŸ”’
List elements: native references (for the native types that have a raw reference conversion), and vectors of any element, nested to any depth.

TraitsΒ§

RootedVecElement πŸ‘»
An element type of a Vec that converts through TryFromRoot. The element decides what the vector reads: character elements read a STRSXP, the others read a list. One Vec<E> impl over this trait, rather than one impl per element shape, keeps a nested Vec<Vec<..>> from sending type inference into unbounded recursion when the element type is not yet known.
TryFromRoot
Convert an R value while retaining its root’s lifetime in the result.

FunctionsΒ§

rooted_list πŸ”’
Each element gets its own root before conversion or the next Elt callback. Merely rooting an ALTREP list does not retain transient Elt results.