Obniz Rust設計

tags: Rust obniz 趣味

リポジトリ

https://github.com/MrBearing/obniz-rust

開発ロードマップ

https://www.mindomo.com/mindmap/obniz_rust-7fb0a99ef73845a9af1369a3d631de5c

外部設計

以下のような書き方でプログラムできると嬉しい。。

let obniz_connector = ObnizConnector::new("1234-5678"); let obniz = match obniz_connector.connect().await { Ok(_) => println!("connect"), _ => panic!() }; loop{ obniz.io_set(0,true); sleep(10); obniz.io_set(0,false); sleep(10); }

内部設計

        
      

参考資料

obnizのWebsocketAPI

https://obniz.com/ja/doc/reference/cloud/hardware-api/websocket-api

設計の参考にしたクレート

https://crates.io/crates/rspotify
https://docs.rs/rspotify/0.10.0/rspotify/

https://github.com/sfackler/rust-postgres
https://docs.rs/tokio-postgres/0.7.2/tokio_postgres/
https://github.com/davidrhyswhite/rust-firebase
https://crates.io/crates/mysql_common
https://crates.io/crates/mongodb
https://crates.io/crates/mysql_async
https://github.com/wyyerd/pulsar-rs

tungstenite , tokioの理解

https://docs.rs/tokio-tungstenite/0.15.0/tokio_tungstenite/struct.WebSocketStream.html#method.forward

他参考資料

https://qiita.com/mutuya/items/b09881839c4e02b2f485

テスト用

https://crossbar.io/autobahn/

メモ

  • 非同期での処理はいらないのでは疑惑
    • 非同期IOのAPIが存在するので実装は必要
  • 後々RestでのAPI操作必要?
    • 先にRestの実装した方が早いかも。。