Skip to main content

try_charsxp_to_cow

Function try_charsxp_to_cow 

Source
pub(crate) unsafe fn try_charsxp_to_cow(
    charsxp: SEXP,
) -> Result<Cow<'static, str>, SexpError>
Expand description

try_charsxp_to_str as a Cow.

Strings whose bytes are their UTF-8 text borrow directly from R. Strings that require encoding translation become owned Rust strings so the translated buffer cannot be invalidated independently of the returned value.