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:
NAreads as""for the plain forms and asNonefor the optional ones.$borrowreads one non-NAelement 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Β§
- Rooted
VecElement π» - An element type of a
Vecthat converts throughTryFromRoot. The element decides what the vector reads: character elements read aSTRSXP, the others read a list. OneVec<E>impl over this trait, rather than one impl per element shape, keeps a nestedVec<Vec<..>>from sending type inference into unbounded recursion when the element type is not yet known. - TryFrom
Root - 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.