Skip to content

Instantly share code, notes, and snippets.

View Twister915's full-sized avatar

Joey Twister915

View GitHub Profile
package main
import (
"context"
"sync"
)
type fanOutResult[K any, R any] struct {
Key K
Result R
@Twister915
Twister915 / topk.rs
Last active April 21, 2022 07:30
topk
use std::marker::PhantomData;
pub enum TopK<I, E, K, F, const N: usize> {
// this TopK has just been created and no data has been computed
// this is the initial state
Prepared {
itr: I,
f: F,
_k: PhantomData<K>,
},