43,906 questions
1
vote
1
answer
37
views
How to split a slice at a given index, then move the remaining elements into a boxed slice without copying or cloning?
We have a boxed slice of an arbitrary type T. I'd like to slice it at a given index, then move the remaining elements after the index into a new Box<[T]>. It's fine if the original Box<[T]>...
-4
votes
0
answers
64
views
Get total download and upload data from a specific process in Linux using Rust [closed]
I find difficult to get total download and upload data from a specific process in Linux. I would like to ask a question, how to do that in Rust language?
I tried to get total donwload and upload data ...
1
vote
1
answer
42
views
How do I build Kismet Debugger as described by the developer?
I am trying to build Kismet Debugger for the UE4SS tool as described in the Kismet Debugger's readme.md file, but I am running into difficulties.
I have tried using x64 Native Build Tools Command ...
-1
votes
0
answers
88
views
"if let" assignment with specified data-type (let Some, let Ok...)
For good readable code I want to specify the actual data type in let assignments, if the right side is complex or misleading. Like:
let strange: DataType::<ComplexWorld<f32>> = ...
-1
votes
0
answers
90
views
Cannot call external C function in Rust [closed]
When I run cargo run, I receive the following error. I am not able to figure why rust is not detecting the badmath function.
➜ unssafe git:(master) ✗ cargo run --verbose
Fresh find-msvc-tools ...
0
votes
0
answers
66
views
Having references in the collision-detection struct (etc.) to Vec items that represents collision objects (etc.)
What if we want to store objects in a Vec, and reference (or index maybe) to a data structure, while maintaining the ability to mutate from the Vec?
Take a look at the brief example below:
// think ...
Advice
1
vote
7
replies
143
views
"if let" assignment with specified data-type
It's good practice for readable code to specify the actual data type in let assignments, if the right side is complex or misleading. Like:
let strange: DataType::<ComplexWorld<f32>> = ...
3
votes
2
answers
61
views
How to do equality check on subset of Rust struct without excessive boilerplate code
Does anyone know how to make it work ( without clone() , without excessive boilerplate code, without repeating .a or .b ( imagine having many such sub-fields in real life code, with large field names,...
2
votes
1
answer
64
views
calling type_id() on a &mut variable
I have this snippet that gives me a compile error:
fn main() {
let mut t = String::from("Hello, world!");
let tt = &mut t;
tt.type_id();
}
error:
error[E0597]: `t` does not ...
0
votes
0
answers
26
views
Regarding the menu theme created with Tauri v2
Even if I run setTheme("light") in my browser and view the Tauri menu,
it remains in the dark theme. The system theme is dark.
Is there a way to change the menu theme?
import { setTheme } ...
1
vote
1
answer
51
views
Question about reference of permission Read and Own
From references-change-permissions-on-places, places have three kinds of permission on their data:
Read (R): data can be copied to another location.
Write (W): data can be mutated.
Own (O): data ...
0
votes
0
answers
35
views
Implementation of the (modular) visitor design pattern
I am creating a QueryBuilder, so I though that it w'd be amazing to serialize objects to tokens, and have an AST within the QueryBuilder. So I immediatly though about the Visitor Design Pattern.
Here'...
0
votes
1
answer
53
views
Rust Iced Markdown View isn't Showing in the window
I've tried the rust iced framework and tried to create a markdown view from the documentation and the code compiles and renderes the windows but the code
pub fn new() -> Self {
Self {
...
0
votes
1
answer
82
views
What happens when I take in &str with AsRef<Path>?
I have the following implementation of to_file for a struct which takes a parameter with AsRef<Path>:
pub fn to_file(&self, path: impl AsRef<Path>) -> anyhow::Result<()> {
...
1
vote
0
answers
73
views
How would I create a shared memory buffer to display animations using the Kitty Graphics Protocol in Rust?
I'm using Arch Linux with Wayland. My terminal is Kitty.
I'm trying to create an animation using the Kitty Graphics Protocol. However, I want this animation to cover the whole screen and run at 60 fps....