GithubHelp home page GithubHelp logo

o5m-stream.rs's Introduction

o5m-stream

streaming async o5m decoder

example

use async_std::{prelude::*,fs::File,io};

type Error = Box<dyn std::error::Error+Send+Sync>;
type R = Box<dyn io::Read+Send+Unpin>;

#[async_std::main]
async fn main() -> Result<(),Error> {
  let args = std::env::args().collect::<Vec<String>>();
  let infile: R = match args.get(1).unwrap_or(&"-".into()).as_str() {
    "-" => Box::new(io::stdin()),
    x => Box::new(File::open(x).await?),
  };
  let mut stream = o5m_stream::decode(infile);
  while let Some(result) = stream.next().await {
    let r = result?;
    println!["{:?}", r];
  }
  Ok(())
}

license

bsd

o5m-stream.rs's People

Stargazers

刘炬光 avatar Andrew Chou avatar

Watchers

 avatar rae avatar James Cloos avatar Marina Kukso avatar

Forkers

sicmade

o5m-stream.rs's Issues

negative ids

id should be i64 to allow for negative ids, which (might be?) used in o5c changesets to specify a document-local id that hasn't yet been assigned

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.