Table

Struct Table 

Source
pub struct Table<Map: MemoryMap, Access: Accessor> { /* private fields */ }
Expand description

A table of a memory mapped text database.

Implementations§

Source§

impl Table<SafeMemoryMap, TsvText>

Source

pub fn text_tsv_from_string(text: String) -> Self

Source

pub fn text_tsv_from_str<S: AsRef<str>>(text: S) -> Self

Source§

impl<Access: Accessor, Map: MemoryMap> Table<Map, Access>

Source

pub fn new(map: Map, accessor: Access) -> Self

Make a new memory mapped text database.

Source

pub fn is_sorted(&self) -> Result<bool>

Return true if the database is sorted. Note: On large files (> 1TB) this may take some time to run.

Source

pub fn keys(&self) -> impl Iterator<Item = Result<&str, Utf8Error>>

Get all the keys as strings. Note: On large files (> 1TB) this may take some time to run.

Source

pub fn cols(&self, i: usize) -> impl Iterator<Item = Result<&str, Utf8Error>>

Get one column as strings.

Source

pub fn get_matching_lines( &self, key: &Access::KeyType, ) -> impl Iterator<Item = Line<'_, Map, Access>>

Return an iterator over all matching lines for a certain key.

Auto Trait Implementations§

§

impl<Map, Access> Freeze for Table<Map, Access>
where Access: Freeze, Map: Freeze,

§

impl<Map, Access> RefUnwindSafe for Table<Map, Access>
where Access: RefUnwindSafe, Map: RefUnwindSafe,

§

impl<Map, Access> Send for Table<Map, Access>
where Access: Send, Map: Send,

§

impl<Map, Access> Sync for Table<Map, Access>
where Access: Sync, Map: Sync,

§

impl<Map, Access> Unpin for Table<Map, Access>
where Access: Unpin, Map: Unpin,

§

impl<Map, Access> UnwindSafe for Table<Map, Access>
where Access: UnwindSafe, Map: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.