Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info about rust release #386

Merged
merged 13 commits into from
Nov 13, 2021
43 changes: 43 additions & 0 deletions _posts/2021-11-09-rust.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
layout: post
title: BrainFlow 4.8.0
subtitle: Rust binding for BrainFlow
image: /img/rust.jpg
tags: [release]
author: andrey_parfenov
---

We are glad to announce, that in latest release of BrainFlow we added support for Rust programming language. All credit goes to [Daniel](https://github.com/trobanga).

***Code sample:***

```rust
use std::{thread, time::Duration};

use brainflow::{board_shim, brainflow_input_params::BrainFlowInputParamsBuilder, BoardIds};

fn main() {
brainflow::board_shim::enable_dev_board_logger().unwrap();
let params = BrainFlowInputParamsBuilder::default().build();
let board = board_shim::BoardShim::new(BoardIds::SyntheticBoard, params).unwrap();

board.prepare_session().unwrap();
board.start_stream(45000, "").unwrap();
thread::sleep(Duration::from_secs(5));
board.stop_stream().unwrap();
let data = board.get_board_data(Some(10)).unwrap();
board.release_session().unwrap();

println!("{}", data.len());
println!("{:?}", data);
}

```

***References:***

* [Installation Instructions](https://brainflow.readthedocs.io/en/stable/BuildBrainFlow.html#rust)
* [API Reference](https://brainflow.readthedocs.io/en/stable/UserAPI.html#rust-api-reference)
* [Examples](https://brainflow.readthedocs.io/en/stable/Examples.html#rust)

Feel free to test it and we are looking forward to seeing your applications with Rust and BrainFlow!
4 changes: 2 additions & 2 deletions features.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3 class="feature-title">Uniform Data Acquisition API for All Devices</h3>
<div class="row">
<div class="col-7"></div>
<div class="col-5">
<h3 class="feature-title">7 Language Bindings</h3>
<h3 class="feature-title">8 Language Bindings</h3>
<br>
</div>
<div class="col-6 code-block">
Expand All @@ -52,7 +52,7 @@ <h3 class="feature-title">7 Language Bindings</h3>
<div class="col-1">
</div>
<div class="col-5">
<p class="feature-paragraph">Deep integration into Python, C++, Java, C# and support for Julia and Matlab.
<p class="feature-paragraph">Deep integration into Python, C++, Java, C# and support for Julia, Matlab and Rust.
This allows a very smooth transition from one programming language to another and simple integration to existing applications!
</p>
</div>
Expand Down
24 changes: 24 additions & 0 deletions get_started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ <h3>Installing BrainFlow</h3>
<button type="button" class="btn btn-default opt languages">R</button>
<button type="button" class="btn btn-default opt languages">Julia</button>
<button type="button" class="btn btn-default opt languages">Cpp</button>
<button type="button" class="btn btn-default opt languages">Rust</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -452,6 +453,19 @@ <h3>Installing BrainFlow</h3>
</div>
</div>
</div>
<div class="rust">
<div class="row">
<div class="col-3 install-left">
<span>Distribution</span>
</div>
<div class="col-9 install-right">
<div class="btn-group opt-group" role="group">
<button type="button" class="btn btn-default environs opt active">crates</button>
<button type="button" class="btn btn-default environs opt">Build from Source</button>
</div>
</div>
</div>
</div>
</div>
<div class="windows">
<div class="csharp">
Expand Down Expand Up @@ -497,6 +511,7 @@ <h3>Installing BrainFlow</h3>
<button type="button" class="btn btn-default opt languages">R</button>
<button type="button" class="btn btn-default opt languages">Julia</button>
<button type="button" class="btn btn-default opt languages">Cpp</button>
<button type="button" class="btn btn-default opt languages">Rust</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -541,6 +556,15 @@ <h4>Python Code Samples</h4>
<p>Refer to the <a href="https://brainflow.readthedocs.io/en/stable/Examples.html#python">BrainFlow Python Code Samples</a>.</p>
</div>

<div class="rust">
<h4>Rust Binding Installation</h4>
<p>Refer to the <a href="https://brainflow.readthedocs.io/en/stable/BuildBrainFlow.html#rust">BrainFlow Rust Installation Guide</a>.</p>
<h4>Rust API Reference</h4>
<p>Refer to the <a href="https://brainflow.readthedocs.io/en/stable/UserAPI.html#rust-api-reference">BrainFlow Rust API Reference</a>.</p>
<h4>Rust Code Samples</h4>
<p>Refer to the <a href="https://brainflow.readthedocs.io/en/stable/Examples.html#rust">BrainFlow Rust Code Samples</a>.</p>
</div>

<div class="java">
<h4>Java Binding Installation</h4>
<p>Refer to the <a href="https://brainflow.readthedocs.io/en/stable/BuildBrainFlow.html#java">BrainFlow Java Installation Guide</a>.</p>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ <h3>Uniform API for All Devices</h3>
</div>
<div class="col-4"><div class="card">
<div class="card-text">
<h3>7 Language Bindings</h3>
<p>Deep integration into Python, C++, Java, C# and support for Julia, Matlab and R. Same API across all bindings.</p>
<h3>8 Language Bindings</h3>
<p>Deep integration into Python, C++, Java, C# and support for Julia, Matlab, R and Rust. Same API across all bindings.</p>
</div>
<div class="key-feature-image">
<img src="https://live.staticflickr.com/65535/51499879008_2e46e9edc1.jpg">
Expand Down