Skip to main content

CowFormat

Trait CowFormat 

Source
pub trait CowFormat: SparseFormat {
    type Owned<T: Send + Sync>: SparseShape + Send + Sync;

    // Required methods
    fn as_storage<T>(owned: &Self::Owned<T>) -> Self::Storage<'_, T>
       where T: Send + Sync;
    fn to_owned_storage<T>(storage: &Self::Storage<'_, T>) -> Self::Owned<T>
       where T: Clone + Send + Sync;
}
Expand description

Maps a sparse format marker to its owned storage and Cow conversions.

Sealed transitively through SparseFormat.

Required Associated Types§

Source

type Owned<T: Send + Sync>: SparseShape + Send + Sync

Heap-owned storage for this format.

Required Methods§

Source

fn as_storage<T>(owned: &Self::Owned<T>) -> Self::Storage<'_, T>
where T: Send + Sync,

Re-borrow owned storage as the format’s view storage (zero-copy).

Source

fn to_owned_storage<T>(storage: &Self::Storage<'_, T>) -> Self::Owned<T>
where T: Clone + Send + Sync,

Clone a borrowed view storage into owned storage (one allocation set).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl CowFormat for Csr

Source§

impl CowFormat for DenseWithMask

Source§

impl<F> CowFormat for Validated<F>
where F: CowFormat,

Source§

impl<const BM: usize, const BN: usize> CowFormat for BlockedCoo<BM, BN>

Source§

type Owned<T: Send + Sync> = OwnedBlockedCoo<T, BM, BN>

Source§

impl<const C: usize> CowFormat for SellP<C>

Source§

type Owned<T: Send + Sync> = OwnedSellP<T, C>