Skip to content

Instantly share code, notes, and snippets.

@siritori
siritori / filter-map.ts
Created January 17, 2021 14:58
operator習作
import { strict as assert } from 'assert';
import { Operator, OperatorFunction, Subscriber } from "rxjs";
export type FilterMap<T, U> = (e: T, index: number) => U | null;
class FilterMapSubscriber<T, U> extends Subscriber<T> {
private count = 0;
private readonly thisArg: any;
constructor(
destination: Subscriber<U>,
@siritori
siritori / test.rs
Created December 9, 2021 22:37
Binary parsing test
use bytes::Buf;
pub trait BinaryRead: Sized {
fn read<T: bytes::Buf>(reader: &mut BinaryReader<T>) -> Option<Self>;
}
pub struct BinaryReader<T: bytes::Buf> {
pub buf: T,
}