Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a Rust development environment for ESP32

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to build a Rust development environment for ESP32". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's take you to learn "How to build a Rust development environment for ESP32"!

cerebrallib -Virtual machine library written in BrainFuck language using Rust

Hands-on project

// src/main.rs code

use cerebrallib::cerebral;

use std::io

fn main() {

let code = String::from("++++");

let mut vm = cerebral::CerebralVM::new(code, io::stdin(), io::stdout());

vm.execute();

}

Pushrod 0.2.11 Released

Pushrod is a GUI library based on piston_windows. This release adds picture buttons, etc. Take a look at the renderings

[Embedded] Build Rust development environment for ESP32 diesel-factories -build factory_bot library for testing

In unit/integration testing, you will often need to insert some data into the database. Factory_bot is one such library, and diesel-factories is its diesel based implementation.

This library is used as follows.

// A normal Diesel model

#[derive(Clone, Queryable)]

struct Country {

pub id: i32,

pub name: String,

}

// Our factory

#[derive(Clone, Factory)]

#[factory(model = "Country", table = "crate::schema::countries")]

struct CountryFactory {

pub name: String,

}

// Setting up what the default values are

impl Default for CountryFactory {

fn default() -> Self {

Self {

name: "Denmark".into(),

}

}

}

#[test]

fn some_test() {

let con = establish_connection();

// Using all the defaults

let denmark = CountryFactory::default().insert(&con);

assert_eq! ("Denmark", denmark.name);

// Defaults can be changed through builder methods

let netherlands = CountryFactory::default()

.name("Netherlands")

.insert(&con);

assert_eq! ("Netherlands", netherlands.name);

}

At this point, I believe that everyone has a deeper understanding of "how to build a Rust development environment for ESP32," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report