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
    In Rust (like most programming languages), the % operator performs the remainder operation, not the modulus operation. ... a function for that! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    The documentation says usize is Operations and constants for pointer-sized unsigned integers. In most cases, I can ... which are so alike. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I have this so far in my goal to Parse this JSON data in Rust: extern crate rustc_serialize; use rustc_serialize:: ... key from it, like Age. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    While I've seen docs on using rustc directly to output assembly, having to manually extract commands used by ... writes out assembly files? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I'd like to update a package that I used cargo install to globally install packages, such as rustfmt or racer. ... . Is there an update command? 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 do this: struct Point { x: i32, y: i32, } impl Point { fn up(&self) { self.y + ... ^^ cannot mutably borrow field of immutable binding See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
2.2k views
1 answer
    I'm trying to install racer using cargo, so I executed the command cargo install racer in the terminal and it ... cargo? Am I missing anything? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    I followed the readme instructions for building Parity from source and then I execute this command: cargo build --release and ... I'm on a Mac. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.8k views
1 answer
    I am struggling with passing a struct through an FFI that accepts void and reading it back on the other end. ... the struct to void and back. 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 trying to create a static executable with Rust. I am not trying to statically link a particular library, ... agrees is statically linked). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
843 views
1 answer
    I'm not sure that I understand why this code won't compile. It seems like the new "vector" Mul specialization ... for `&Matrix<_, RowMajor>` See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
993 views
1 answer
    I would like to initialize a variable during compilation time. For example, I would like to initialize the variable ... it possible to do this? 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 the following code: pub enum Direction { Up, Right, Down, Left, None } struct Point { y: i32, x: ... a working variant of what I pasted? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
862 views
1 answer
    I have a struct Foo<T> where T: // ... some complex trait bound ... { a: Bar, b: Option<T>, } ... not found such a type in the documentation. 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 rewriting a simple TCP based server to experiment with Rust. It should retrieve input of an client and ... explain didn't help me either See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    The documentation for reqwest v0.9.18 shows the following example of posting a file: let file = fs::File:: ... method for sending a file? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
972 views
1 answer
    use std::iter::Peekable; pub trait AdvanceWhile<I: Iterator> { fn advance_while<P>(&mut self, predicate: P) ... | - first borrow ends here See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
995 views
1 answer
    What is the idiomatic way to iterate (read) over the first half of the vector and change the structure of the second half of ... 1); j--; } } } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    I'm doing something like this: fn main() { //[1, 0, 0, 0, 99]; // return [2, 0, 0, 0, 99] // ... slice I want to test! Is the let really needed? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
963 views
1 answer
    I found Primitive through Google but it appears to be from a pre-beta version and my compiler (beta 3) ... hasn't thrown up anything promising See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
950 views
1 answer
    I am trying to share a struct between two files, but I am getting an error. I have the ... struct 'LoginService::Login:UserLoginResponse' See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I have some mutable state I need to share between threads. I followed the concurrency section of the Rust book, ... way to accomplish this is. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    I am really new to Rust, I am having trouble solving this error, but it only happens if I comment out ... ` dropped here while still borrowed See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
832 views
1 answer
    I'm building a Redis Module in Rust. I've found some good examples, but I'm stuck when dealing with interfacing a C ... ... and so on */). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
921 views
1 answer
    I want to specialize &'static str from &'a str: use std::borrow::Cow; struct MyString { inner: Cow<' ... something that Rust will ever support? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    My goal is to delegate method calls against my struct to a Trait's methods, where the Trait object is inside ... the Trait object in each call. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    The compiler allows me to write blanket implementation a function like this: trait Invoke { type S; type E; fn fun(&mut ... E> { self(arg) } } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
873 views
1 answer
    I'm not trying to write sophisticated code, I just want to understand what is (or is not) going on here ... break the operation into two chunks. 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

...