[][src]Trait flatk::StorageInto

pub trait StorageInto<Target> {
    type Output;
    fn storage_into(self) -> Self::Output;
}

Transform the access pattern of the underlying storage type. This is useful when the storage is not just a simple Vec or slice but a combination of independent collections.

Associated Types

type Output

Loading content...

Required methods

fn storage_into(self) -> Self::Output

Loading content...

Implementations on Foreign Types

impl<'a, T: Clone> StorageInto<Vec<T>> for &'a [T][src]

Convert a slice into an owned Vec type.

type Output = Vec<T>

impl<'a, T: Clone> StorageInto<Vec<T>> for &'a mut [T][src]

Convert a mutable slice into an owned Vec type.

type Output = Vec<T>

impl<'a, T: 'a> StorageInto<&'a [T]> for &'a mut [T][src]

Convert a mutable slice into an immutable borrow.

type Output = &'a [T]

impl<U, V, S: StorageInto<U>, T: StorageInto<V>> StorageInto<(U, V)> for (S, T)[src]

type Output = (S::Output, T::Output)

impl<T, S: Into<T>> StorageInto<Vec<T>> for Vec<S>[src]

Convert a Vec of one type into a Vec of another type given that the element types can be converted.

Example

use flatk::*;
let sentences = vec!["First", "sentence", "about", "nothing", ".", "Second", "sentence", "."];
let chunked = Chunked::from_sizes(vec![5,3], sentences);
let owned_sentences: Chunked<Vec<String>> = chunked.storage_into();
assert_eq!(Some(&["Second".to_string(), "sentence".to_string(), ".".to_string()][..]), owned_sentences.view().get(1));

type Output = Vec<T>

Loading content...

Implementors

impl<S: StorageInto<T>, I, T> StorageInto<T> for Select<S, I>[src]

Pass through the conversion for structure type Select.

type Output = Select<S::Output, I>

impl<S: StorageInto<T>, I, T> StorageInto<T> for Subset<S, I>[src]

Pass through the conversion for structure type Subset.

type Output = Subset<S::Output, I>

impl<S: StorageInto<T>, N, T> StorageInto<T> for UniChunked<S, N>[src]

Pass through the conversion for structure type UniChunked.

type Output = UniChunked<S::Output, N>

impl<S: StorageInto<T>, O, T> StorageInto<T> for Chunked<S, O>[src]

Pass through the conversion for structure type Chunked.

type Output = Chunked<S::Output, O>

impl<S: StorageInto<U>, T, I, U> StorageInto<U> for Sparse<S, T, I>[src]

Pass through the conversion for structure type Subset.

type Output = Sparse<S::Output, T, I>

Loading content...