Consider the following code: use std::net::IpAddr; pub struct Server { host: IpAddr } impl Server { fn new(host: IpAddr) -> Self { Self {ho
I want to use RSA-PSS algorithm to sign and verify data by using rust openssl crate. But I ran into some problems. Here is my code: use openssl::sign::{Sign
Trying to replace all the \n character after the word 'key2:' pattern with comma. Input String: key1:value1\nkey2:value2\nvalue22\nvalue222 Expected: key1:valu
Given the macro matching example, this shows how macros can match an argument. I've made very minor changes here to use numbers: macro_rules! foo { (0 =&g
I'm receiving RecordBatches serialized as bytes and I'm trying to de-serialize into RecordBatches. Using StreamReader::try_new() and passing in the byte data an
Background Imagine the situation: static library libR.a is written rust and it depends on libCXX0.a. Binary X depends on both libR.a and libCXX0.a and it is wri
I try to build my own init with rust language. this is my example code : use std::process::Command; fn main() { loop { println!("Welcome to custom
I need decompress and unpack big .tar.gz files (e.g. ~5Gb) in download process without save an archive file on disk. I use reqwest crate for downloading files,
I'm making an emulated os that uses a browser to render and a abstraction of file system to allow apps to access their folders only. However, since it's an laye
I have created a rust tcp server framework. (https://github.com/HasinZaman/SingleThreadServer) The framework works fine without any issue on my local machine; a
Today when I using cargo cargo 1.59.0 (49d8809dc 2022-02-10) compile the rust rustc 1.59.0 (9d1b2106e 2022-02-23) project, shows error: error[E0412]: cannot fin
I am trying to CPI the Token Program to send spl-tokens to a wallet. For this the derive accounts in the context struct has three accounts without any attribute
I'm trying to create an Iterator interface using the csv crate such that I can return a HashMap of col-name: value and am running into a lifetime error I cannot
In Rust you can inspect environment variables at compile time like so: let sha: Option<&'static str> = option_env!("CI_COMMIT_SHA"); println!("CI_COMM
I'm quite new to rust and actix, but I tried to build a technology prototype where a server sends protobuf messages to clients via websockets. The protobuf part
I have invoked a function from my frontend to my backend. It works however I want to return results back to frontend and all I get is null #[tauri::command] fn
I have the following rust code and for the life of me I cant workout why I am getting a borrow-checker issue with this value and why does it get moved as part o
I have a file, say myfile. Using Rust, I would like to open myfile, and read bytes N to M into a Vec, say myvec. What is the most idiomatic way to do so? Naivel
See some code below: #[derive(Debug)] struct MyString { a: String, } impl MyString { fn new(s: &str) -> Self { MyString { a: String::fro
I know about how to run programs at startup on Windows, but not Linux (even though I use Linux myself). Is there a library I can use which will automatically ru