Category:Rust

  • What is the difference between * const T and * mut t in rust?

    Time:2021-4-23

    *const Tand*mut TWhat’s the difference? Why is unique implemented using*const TInstead of using*mut T? answer: (1) The difference after dereference,*const TPointer dereference correspondence & T,*mut TDereference correspondence & mut T; (2) In secure code, you can*const TConvert to*mut TBefore dereferencing, it is the original bare pointer, which can be converted between the original bare pointers; […]

  • Implementation of PeerStore in the version of trust

    Time:2021-4-23

    Module address:https://github.com/netwarps/l… In trust libp2p, when the protocol wants to get peer_ The address of networkbehavior needs to be implemented when the address corresponding to the ID is used_ of_ Peer method. In contrast, go libp2p uses PeerStore to store peers_ The relationship between ID and address, so we can refer to it to implement […]

  • Recommend a rust Journal

    Time:2021-4-22

    Rust language open source magazine (2021) I also contributed an articleIntroduction to front end: rust and webassembly If you are interested in webassembly, you can communicate and learn togetherA plug-in to quickly start wasm project at the front endvite-plugin-rsw This work adoptsCC agreementReprint must indicate the author and the link of this article lencx

  • Analysis of kbucket in libp2p RS

    Time:2021-4-22

    At present, the kad protocol has been implemented on the main line of the project, and kbucket, as a part of the storage node, is worth an analysis. Brief introduction to kbucket In kad, every time peer gets the information of a node, it will store it in its own kbucket. Each peer_ ID is […]

  • Rust tutorial: introduction to rust for JavaScript developers

    Time:2021-4-21

    Rust is a programming language originated from Mozilla research in 2010. Today, all the big companies are using it. Amazon and Microsoft agree that it is the best alternative to C / C + + in their systems, but rust is more than that. Companies like figma and discord are now leading the way by […]

  • 013 the type conversion of the book of the dead

    Time:2021-4-21

    introduce The video recorded in this series is mainly on station BRust necromancer learning video Rust necromancer related source information ingithub.com/anonymousGiga/Rustonomi… Type conversion Consider an example: struct Foo { a: i32, b: i32, } struct Bar { a: i32, b: i32, } fn main() { let f = Foo{a: 1, b: 2}; //let _b: Bar […]

  • The explicit type conversion of 014 rust Necromancer

    Time:2021-4-20

    introduce The video recorded in this series is mainly on station BRust necromancer learning video Rust necromancer related source information ingithub.com/anonymousGiga/Rustonomi… Knowledge points Explicit type conversion is a superset of mandatory type conversion. All mandatory type conversions can be triggered by explicit conversion. Some scenarios work only with explicit type conversions. Explicit type conversion uses […]

  • The load time of trust analyzer is too long

    Time:2021-4-20

    Development environment:vscode+rust-analyzerQuestion:Vscode is stuck all the timefetching metadataStage.method:functioncargo metadata, found Blocking waiting for file lock on package cache function rm -rf ~/.cargo/.package-cache Delete the cache of cargo and run it againcargo metadataI didn’t find out laterblockingRestart vscdoe and load trust analyzer successfully. reference resources rust-analyzer issue616 Blocking waiting for file lock on package cache always […]

  • Transmutes transformation of 015 rust Necromancer

    Time:2021-4-19

    The video recorded in this series is mainly on station BRust necromancer learning video Rust necromancer related source information ingithub.com/anonymousGiga/Rustonomi… introduce MEM:: transmute < T, u > takes a value of type T and resolves it back to type U. T and u are required to be the same size.This kind of operation is unsafe […]

  • Rust and python: why rust can replace Python

    Time:2021-4-18

    In this guide, we compare the rust and python programming languages. We will discuss the applicable use cases in each case, review the advantages and disadvantages of using rust and python, and explain why rust might replace python. I will introduce the following: What is rust? What is Python? When to use rust When to […]

  • 016 rush Necromancer’s safe memory initialization

    Time:2021-4-17

    The video recorded in this series is mainly on station BRust necromancer learning video Rust necromancer related source information ingithub.com/anonymousGiga/Rustonomi… introduce All runtime allocated memory starts “uninitialized.”. Rust provides ways to handle uninitialized memory, both secure and insecure. safe mode All variables on the stack are uninitialized before explicit assignment, but rust prevents programmers from […]

  • Libp2p RS v0.2.1 & 0.2.2

    Time:2021-4-17

    V0.2.1 was released on 1.26, adding support for async STD and Tokio. 0.2.2 was released on 3.1. Most of the problems in this version are found in the process of transplanting trust IPFs. At present, the migration has been completed. The project address ishttps://github.com/netwarps/r…The main content of the update is to upgrade and optimize the […]