Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged rust

0 votes
1.2k views
1 answer
    I'm learning Rust and tried coding a doubly-linked list. However, I'm stuck already at a typical iterative ... non-recursive) to this problem. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I was playing around with some code and made the following observation: let x = 1; let () = x; error: mismatched ... ` = note: found type `()` See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    In Rust 1.15, I have created a trait to abstract over reading & parsing file format(s). I'm trying to ... do I create my MyIterThing struct? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    While following the rustbyexample.com tutorial, I typed the following code: impl fmt::Display for Structure { fn fmt ... relevant (or not) here? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    Consider the following code sample (playground). #[derive(PartialEq, Clone, Debug)] enum State { Initial, One ... as a relatively new Rustacean. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    I have a struct which holds registers. I want my read_register function to return a u8 for Register::V0 and Register::V1 ... => self.v3, } } } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    c_strange_t is an opaque C type that is only seen behind a pointer. When wrapping this type, there are times when ... and how would it be done? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I don't understand why the code below does not compile. It seems like rust is just not 'expanding' ... terminated with error code 101 See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    I want to terminate reading from a tokio::io::lines stream. I merged it with a oneshot future and terminated ... can I stop reading from this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    Code: use std::collections::HashSet; use std::{mem, ptr, fmt}; use std::ops::Deref; enum Unsafety { ... .node expression should be the same. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I am reading the section on closures in the second edition of the Rust book. At the end of this section, there ... there a way to avoid this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I am writing a program that writes to a file and rotates the file it's writing to every now and then. When ... should be returned doesn't work. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I have a tokio core whose main task is running a websocket (client). When I receive some messages from the ... entire code is single-threaded? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    I'm trying to print out a tree (it's a LinkedList right now, but that will be fixed): use std::io; use ... plus 'next' does not live long enough See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.9k views
1 answer
    I'm using the Actix framework to create a simple server and I've implemented a file upload using a simple HTML ... don't know what to do. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    I have this fairly straightforward Rust program: use std::ops::Deref; trait Foo { fn foo(&self); } impl Foo ... unrelated. How do I fix this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I'm very new to Rust so I may have terminology confused. I want to use the hashes crates to do some ... use it through the trait interface? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I am trying to select a digest algorithm (from rust-crypto) based on a configuration string. In Python or JavaScript, ... to do this in Rust? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I set myself a little task to acquire some basic Rust knowledge. The task was: Read some key-value pairs from ... no idea how to achieve this. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I am writing a macro which creates a struct managing user input. I am using the crates bitflags and sdl2. Return ... (flag, Flag, FLAG)? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I am trying to implement the Iterator trait for a struct which acts as a borrower of an array of i32 values, but I keep ... | ^^^^^^^^^^^^^ See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I want to write the end of a slice to the top of the same slice. let mut foo = [1, 2, 3, 4, 5]; ... (for example, by using foo.as_ptr()). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    I would like to get the last element of a vector and use it to determine the next element to push in. Here's an ... be a good way to do this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    The Rust documentation gives this example where we have an instance of Result<T, E> named some_value: match ... or impossible?) to avoid. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
985 views
1 answer
    I have the following code, where I'm trying to return the struct Foo with a set of default values for the field ... (); my_foo.values.push(3); See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    Answers to What are the differences between Rust's `String` and `str`? describe how &str and String relate ... breaking lots of existing code? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    Are variables of type Vec<[f3; 5]> stored as one contiguous array (of Vec::len() * 5 * sizeof(f32) bytes) or is it stored as a Vec of pointers? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I have a small struct containing only an i32: struct MyStruct { value: i32, } I want to implement Ord in ... there any way to accomplish this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...