Tag:rust

  • Rust: use libloader to call dynamic link library

    Time:2022-12-8

    A recent need to use Rustdynamic callDynamic link library, originally intended to be usedlibloadingyes, butlibloadingWhen calling a function in a dll, it is necessary to determine the types of parameters and return at compile time. but later found outlibloaderthis bag,libloaderis based onlibloading, but it works better thanlibloaderconvenient. We first need adynamic link library, we can […]

  • Wenpan Rust — how to package configuration files into binary files

    Time:2022-12-7

    In actual development, various configuration files are often encountered. Usually, various configurations of program running are read from the outside to enhance the flexibility of application configuration. Springboot in the java ecosystem provides a model of this design. The application of springboot loads the configuration through application.yml by default. The default application.yml file is entered […]

  • [Recruitment] Datan Technology is looking for excellent interns / 23rd school enrollment / social recruiting boss

    Time:2022-12-6

    1. Recruiting positions 1. Rust distributed storage development 【Job Responsibilities】Participate in the research and development of high-performance distributed storage systems, including but not limited to: Distributed system development; Distributed data consistency protocol; Distributed cache, data management services. 【basic requirements】 Familiar with multi-threaded and high-concurrency programming; Familiar with Linux operating system storage management related functions; Has […]

  • rust double colon operator

    Time:2022-12-5

    Seeing the double colon operator for the first time::is in the tutorial Rust programming language Chinese version String type in chapter 5“Method Syntax”part will focus on explaining this syntax and in Chapter 7“Paths are used to refer to items in the module tree”Module namespaces are covered in . If you want to know more, just […]

  • Task scheduling analyzed by Tokio

    Time:2022-12-4

    Introduction Tokio is the most famous asynchronous execution framework in the Rust world, which includes almost all asynchronous execution interfaces, including but not limited to file, network and file system management. Below these convenient high-level interfaces are some “cornerstones”. They do not exist in the interfaces that users directly interact with, but hide under the […]

  • Wenpan Rust — life cycle in struct

    Time:2022-12-3

    Recently, I am using rust to write a redis data verification tool.redis-rsIt has redis::ConnectionLike trait, which can be used to better abstract the verification process. During development, it is inevitable to define some elements in the struct as trait objects, which brings about some life cycle problems in the rust language.This article does not specifically […]

  • An introductory Rust tutorial for frontends

    Time:2022-12-2

    getting Started Install Rust Install rustup on linux and mac $ curl –proto ‘=https’ –tlsv1.2 https://sh.rustup.rs -sSf | sh A successful installation will display Rust is installed now. Great! Install rustup on Windows type of data character Javascript const str = “hello”; const string = String(“hello”); // character merge const longString = “a” + “b”; […]

  • Some in Rust

    Time:2022-12-2

    1. First of all, we must know what is Option and Resultsource:Many languages ​​use null/nil/undefined types to represent empty output and handle exceptions. Rust skips, especially preventing things like null pointer exceptions, sensitive data leaks due to exceptions, etc. Instead, Rust provides two special class enumerations: Option and Result to handle the above problemscontent: Optional […]

  • Rust Chat Room: Xline-Cross Data Center Consistency Management

    Time:2022-12-1

    brief introduction With the increasing business scale of the Internet and cloud computing, a single data center can no longer meet the needs of the business, the business system is developing from a single data center to multiple data centers, and the demand for multi-site, multi-center and multi-active deployment is becoming more and more common. […]

  • Impls & Traits in Rust

    Time:2022-12-1

    ✅impls are often used to define Rust’s structs and enums methods✅ Traits are a bit like interfaces in OOP languages. They are generally used to define the functionality that must be provided. Most traits can be implemented for a single type But traits can also contain default method implementations, which can be overridden when implementing […]

  • Rust omits the use of the return keyword

    Time:2022-11-30

    In the function of rust, you can not write return Like in python, not writing return means return None But in rust, rust omits the return keyword, “The function will use the execution result of the last statement as the return value by default” reference:Rust functions

  • Rust Tutorial

    Time:2022-11-29

    variable main pointThe variable (let) is immutable by default. If you want to change it, you need to use a variable variable (keyword mut) immutable variable let x = 0; println!(“The value of x is: {}”, x); x = 1; //Error cannot assign twice to immutable variable `x` println!(“The value of x is:{}”, x); The […]