Skip to main content

AltString

Trait AltString 

Source
pub trait AltString: AltVec {
    const HAS_SET_ELT: bool = false;
    const HAS_IS_SORTED: bool = false;
    const HAS_NO_NA: bool = false;

    // Required method
    fn elt(x: SEXP, i: R_xlen_t) -> SEXP;

    // Provided methods
    fn set_elt(_x: SEXP, _i: R_xlen_t, _v: SEXP) { ... }
    fn is_sorted(_x: SEXP) -> i32 { ... }
    fn no_na(_x: SEXP) -> i32 { ... }
}
Expand description

String vector methods.

REQUIRED: elt must be implemented (no default). R will error with “No Elt method found” if you don’t provide it.

Provided Associated Constants§

Source

const HAS_SET_ELT: bool = false

Set to true to register set_elt.

Source

const HAS_IS_SORTED: bool = false

Set to true to register is_sorted.

Source

const HAS_NO_NA: bool = false

Set to true to register no_na.

Required Methods§

Source

fn elt(x: SEXP, i: R_xlen_t) -> SEXP

Get string element at index. Returns CHARSXP. This is REQUIRED for ALTSTRING - there is no default.

Provided Methods§

Source

fn set_elt(_x: SEXP, _i: R_xlen_t, _v: SEXP)

Set element (for mutable strings).

Source

fn is_sorted(_x: SEXP) -> i32

Sortedness hint.

Source

fn no_na(_x: SEXP) -> i32

NA-free hint.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AltString for &'static [&'static str]

Source§

impl AltString for &'static [String]

Source§

impl AltString for Box<[String]>

Source§

impl AltString for Vec<Cow<'static, str>>

Source§

impl AltString for Vec<Option<Cow<'static, str>>>

Source§

impl AltString for Vec<Option<String>>

Source§

impl AltString for Vec<String>

Source§

impl<const N: usize> AltString for [String; N]

Implementors§

Source§

impl<I: Iterator<Item = String> + 'static> AltString for IterStringData<I>