StorageInto

Trait StorageInto 

Source
pub trait StorageInto<Target> {
    type Output;

    // Required method
    fn storage_into(self) -> Self::Output;
}
Expand description

Convert the storage type into another using the Into trait.

Required Associated Types§

Required Methods§

Source

fn storage_into(self) -> Self::Output

Implementations on Foreign Types§

Source§

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

Convert a mutable slice into an immutable borrow.

Source§

type Output = &'a [T]

Source§

fn storage_into(self) -> Self::Output

Source§

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

Convert a slice into an owned Vec type.

Source§

type Output = Vec<T>

Source§

fn storage_into(self) -> Self::Output

Source§

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

Convert a mutable slice into an owned Vec type.

Source§

type Output = Vec<T>

Source§

fn storage_into(self) -> Self::Output

Source§

impl<T, S: Into<T>> StorageInto<Vec<T>> for Vec<S>

Source§

fn storage_into(self) -> Self::Output

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));
Source§

type Output = Vec<T>

Source§

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

Source§

type Output = (<S as StorageInto<U>>::Output, <T as StorageInto<V>>::Output)

Source§

fn storage_into(self) -> Self::Output

Implementors§

Source§

impl<S: StorageInto<T>, I, T> StorageInto<T> for Select<S, I>

Pass through the conversion for structure type Select.

Source§

type Output = Select<<S as StorageInto<T>>::Output, I>

Source§

impl<S: StorageInto<T>, I, T> StorageInto<T> for Subset<S, I>

Pass through the conversion for structure type Subset.

Source§

type Output = Subset<<S as StorageInto<T>>::Output, I>

Source§

impl<S: StorageInto<T>, N, T> StorageInto<T> for UniChunked<S, N>

Pass through the conversion for structure type UniChunked.

Source§

impl<S: StorageInto<T>, O, T> StorageInto<T> for Chunked<S, O>

Pass through the conversion for structure type Chunked.

Source§

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

Pass through the conversion for structure type Subset.

Source§

type Output = Sparse<<S as StorageInto<U>>::Output, T, I>