pub struct IdIndex<K> {
map: HashMap<K, i32>,
frozen: bool,
}Expand description
Index identifiers from a data type
Fields§
§map: HashMap<K, i32>§frozen: boolImplementations§
Source§impl<K> IdIndex<K>
impl<K> IdIndex<K>
Sourcepub fn intern<Q>(&mut self, key: &Q) -> Result<i32, IndexError>
pub fn intern<Q>(&mut self, key: &Q) -> Result<i32, IndexError>
Get the ID for a key, adding it to the index if needed.
Sourcepub fn intern_owned(&mut self, key: K) -> Result<i32, IndexError>
pub fn intern_owned(&mut self, key: K) -> Result<i32, IndexError>
Get the ID for a key, adding it to the index if needed and transferring ownership.
Sourcepub fn keys(&self) -> Keys<'_, K, i32>
pub fn keys(&self) -> Keys<'_, K, i32>
Iterate over keys (see std::collections::HashMap::keys).
Source§impl IdIndex<String>
impl IdIndex<String>
Sourcepub fn record_batch(&self, id_col: &str, key_col: &str) -> Result<RecordBatch>
pub fn record_batch(&self, id_col: &str, key_col: &str) -> Result<RecordBatch>
Convert this ID index into an Arrow RecordBatch, with columns for ID and key.
Auto Trait Implementations§
impl<K> Freeze for IdIndex<K>
impl<K> RefUnwindSafe for IdIndex<K>where
K: RefUnwindSafe,
impl<K> Send for IdIndex<K>where
K: Send,
impl<K> Sync for IdIndex<K>where
K: Sync,
impl<K> Unpin for IdIndex<K>where
K: Unpin,
impl<K> UnwindSafe for IdIndex<K>where
K: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more