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
927 views
1 answer
    I'm trying to run my tests with nightly Rust using Windows Powershell. I run cargo test in the directory, and I ... or any website I've found. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
778 views
1 answer
    In the docs for the Send trait, I see both impl<T> Send for LinkedList<T> where T: Send, and impl< ... impl declarations for my own trait? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I'm trying to implement a commonly used pattern - using the result of a previous loop iteration in the next loop ... it's supposed to be done. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
878 views
1 answer
    A custom type by default is moved through default assignment. By implementing the Copy trait, I get "shallow ... that that would have worked. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    How does one round a f64 floating point number in Rust to a specified number of digits? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
718 views
1 answer
    Is it possible to do something like this in Rust? trait Foo<T> {} struct A; struct B; struct Bar<T: ... single thread and multi thread usage. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    Let's consider the following examples: main.rs use futures::executor::block_on; use futures::future::{FutureExt, ... (4560ea788 2019-11-04) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
707 views
1 answer
    When talking about imports, the word prelude is used every so often by the rustaceans. What is this prelude they ... it affect my Rust programs? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
751 views
1 answer
    I have an enum with many values and I'd like to write the name of one of its values to a stream: ... formatting calculations I want to do. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
646 views
1 answer
    Just to get better understanding of the Send and Sync traits, are there examples of types that either: Implement ... and do not implement Send. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
853 views
1 answer
    Go seems to be able to print structs and arrays directly. struct MyStruct { a: i32, b: i32 } and let arr: [i32; 10] = [1; 10]; See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
791 views
1 answer
    This Rust tutorial explains the fold() mechanism well, and this example code: let sum = (1..4).fold(0, |sum, ... m using Rust beta, 2015-04-02. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
784 views
1 answer
    I'm asking for the equivalent of fgets() in C. let line = ...; println!("You entered: {}", line); I've read ... fgets() or sscanf("%s",...). 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 to convert the PathBuf variable to a String to feed my function. My code is like this: let cwd = ... suggestions on how to handle it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
735 views
1 answer
    I came across some output I don't understand using Vec::get. Here's the code: fn main() { let command = [( ... why .get() returns Some or None? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
771 views
1 answer
    Although vectors are best suited for procedural programming, I would like to use a map function on them. The following ... way to deal with it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
632 views
1 answer
    What does TypeState refer to in respect to language design? I saw it mentioned in some discussions regarding a ... by mozilla called Rust. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
810 views
1 answer
    I'm looking for the right method to statically register structures at compile time. The origin of this ... preferably at compile time. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
793 views
1 answer
    I'm trying to write the examples in the book "SFML Game Development" but I'm having a problem with the lifetimes ... if I have given it one? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I have specified a few features inside Cargo.toml: [features] complex = [] simple = [] When I build my project I ... the cfg! macro in my case? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
736 views
1 answer
    pub trait AllValues { fn all_values() -> Vec<Self> where Self: std::marker::Sized; } use rand:: ... Rand for things that implement AllValues? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    Let's say I have JSON data like the following: { "type": "A", "value": [ 1, 2, 3, 4, ... serde deserialization to properly decode these values? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I want a min() method for f32, u32 and i32, so I created a trait Min: trait Min { fn min(v1 ... Ord. Why there are conflicting implementations? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
825 views
1 answer
    How can I return an iterator over data within a mutex which itself is contained within a struct. The error the ... link: http://is.gd/voukyN See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
696 views
1 answer
    After I read the subtyping chapter of the Nomicon, I couldn't wrap my head around covariance of a type ... only use cases are invariants? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I have two &str pointing to the same string, and I need to know the byte offset between them: fn main() ... is not implemented on raw pointers. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    A is a structure which contains a vector of B. A implements the add_b method which adds a B instance to the ... different closures to A's b_vec? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
908 views
1 answer
    The code is something like the following, in a function that is an implementation for a Context struct, ... for demonstrative purposes only. See Question&Answers more detail:os...
asked Oct 17, 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

...