Expand description
Cow, PathBuf, OsString, and string collection conversions.
Cow<'static, [T]>— zero-copy borrow of R native vectorsCow<'static, str>— zero-copy borrow of R character scalarsPathBuf/OsString— from STRSXP viaStringintermediaryHashSet<String>/BTreeSet<String>— string set conversions
§Tradeoff
These TryFromSexp impls reject mismatched
[SEXPTYPE]s — there is no looser coercion path for Cow / PathBuf /
OsString. The 'static lifetime on Cow borrows is valid only for the
duration of the enclosing .Call; if you need an owned value that
outlives R’s GC, take String or Vec<T> instead (see
strings and references).
Macros§
- impl_
set_ 🔒string_ try_ from_ sexp - impl_
string_ 🔒wrapper_ try_ from_ sexp - Generate TryFromSexp impls for types that are
From<String>(scalar, Option, Vec,Vec<Option>). Used for PathBuf and OsString which delegate to String conversion.