# Embedded Rust Interface

**URL:** <https://discuss.tvm.apache.org/t/embedded-rust-interface/13759>\
**Category:** RFC\
**Created:** [October 20, 2022, 4:08pm UTC](https://discuss.tvm.apache.org/t/embedded-rust-interface/13759 "2022-10-20T16:08:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mousius](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/mousius/32/2607_2.png) [@Mousius](https://discuss.tvm.apache.org/u/Mousius)\
**Post date:** [October 20, 2022, 4:08pm UTC](https://discuss.tvm.apache.org/t/embedded-rust-interface/13759/1 "2022-10-20T16:08:05Z")

</div>

Building upon the great work of the TVM community in making microTVM a success, the natural companion for the [[RFC] [uTVM] Embedded C Runtime Interface](https://discuss.tvm.apache.org/t/rfc-utvm-embedded-c-runtime-interface/9951) is the [Embedded Rust API](https://github.com/apache/tvm-rfcs/pull/96). Allowing us to write Rust applications such as:

```auto
#[path = "../../codegen/host/src/tvmgen_default.rs"]
mod tvmgen_default;

mod my_app_logic;

fn main() {
  let mut input_data: [i8; 25600] = my_app_logic::create_input();
  let mut output_data: [f32; 12] = my_app_logic::create_output();

  let mut model_input = tvmgen_default::Inputs::new(&mut input_data);
  let mut model_output = tvmgen_default::Outputs::new(&mut output_data);

  tvmgen_default::run(&mut model_input, &mut model_output);
  assert_eq!(output_data, my_app_logic::expected_output());
}

```

More detail is available on [the RFC itself](https://github.com/apache/tvm-rfcs/pull/96), all feedback welcome 😸
