Async – join! macro
The join! macro is particularly useful when you need to run multiple asynchronous tasks concurrently and wait for all of them to complete before proceeding further. It’s commonly used in scenarios where you have independent asynchronous operations that can execute simultaneously, and you want to optimize the overall execution time by running them concurrently. Here […]
Automate Docx creation with Rust
Using Docx-rs we can write some code and compile it to allow us to create Word document (Docx) files using text and images that the user is able to specify either via command line or via a script (e.g Python). How does it work? Using compiled Rust code, and a Rust crate called docx-rs you […]
Create a GUI in Rust with iced – “guissh”
I’ve built a GUI for connecting to remote hosts using SSH. The goal was to learn how to use iced in a real world project called “guissh” – https://youtu.be/uFeOHqomBtI The “guissh” GUI can be adapted to send and receive commands via SSH, eg to a server, router, firewall, switch or IoT device. What is iced? […]
Sorting in Rust
Current implementation The current algorithm is an adaptive, iterative merge sort inspired by timsort. It is designed to be very fast in cases where the slice is nearly sorted, or consists of two or more sorted sequences concatenated one after another. To sort you can use itertools : https://doc.rust-lang.org/std/collections/
Proof of work
Proof of Work (PoW) is a consensus mechanism in blockchain technology. It requires participants, called miners, to solve complex mathematical puzzles to validate transactions and create new blocks. The first miner to solve the puzzle broadcasts the solution, and others verify it. PoW ensures security and decentralization.
Trait Objects and dynamic dispatch
Dynamic dispatch in Rust allows treating different types implementing a trait uniformly through trait objects like Box<dyn Trait>. It provides flexibility by resolving method calls at runtime, enabling runtime polymorphism. This is particularly useful when dealing with collections of diverse types sharing a common trait. “This works differently from defining a struct that uses a […]