pub struct AsFromStrVec<T>(pub Vec<T>);Expand description
Wrap a Vec<T: FromStr> parsed from an R character vector.
Each element of the R character vector is parsed into T.
All parse errors are collected with their indices.
§Example
ⓘ
use std::net::IpAddr;
#[miniextendr]
fn parse_ips(addrs: AsFromStrVec<IpAddr>) -> Vec<bool> {
addrs.0.into_iter().map(|ip| ip.is_loopback()).collect()
}
// R: parse_ips(c("127.0.0.1", "8.8.8.8")) → c(TRUE, FALSE)Tuple Fields§
§0: Vec<T>Trait Implementations§
Source§impl<T: Clone> Clone for AsFromStrVec<T>
impl<T: Clone> Clone for AsFromStrVec<T>
Source§fn clone(&self) -> AsFromStrVec<T>
fn clone(&self) -> AsFromStrVec<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for AsFromStrVec<T>
impl<T: Debug> Debug for AsFromStrVec<T>
Source§impl<T: FromStr> TryFromSexp for AsFromStrVec<T>
impl<T: FromStr> TryFromSexp for AsFromStrVec<T>
Auto Trait Implementations§
impl<T> Freeze for AsFromStrVec<T>
impl<T> RefUnwindSafe for AsFromStrVec<T>where
T: RefUnwindSafe,
impl<T> Send for AsFromStrVec<T>where
T: Send,
impl<T> Sync for AsFromStrVec<T>where
T: Sync,
impl<T> Unpin for AsFromStrVec<T>where
T: Unpin,
impl<T> UnsafeUnpin for AsFromStrVec<T>
impl<T> UnwindSafe for AsFromStrVec<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more