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.3k views
1 answer
    I'm trying to code a generic recursive data structure. As it turns out, I can't as I'm hitting a wall when I ... reference? I'm using Rust 1.1. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    According to the Rust Reference: The isize type is a signed integer type with the same number of bits as the platform' ... 2GB in Rust? Or not? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    Why can I have multiple mutable references to a static type in the same scope? My code: static mut CURSOR: ... got from get_b() individually? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.6k views
1 answer
    I'm trying to access command line arguments. If the argument exists, do something, if not, do nothing. I have this ... what I'm trying 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
    From this tutorial: An if without an else always results in () as the value. Why does Rust impose this restriction and doesn ... x == 5 { 10 }; See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    This code works, but I want to explicitly declare the type of the index range max. However uX or iX, where X = 8, 16 ... , arr2[ii][jj]); } } } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    In C++, it is possible to customize the code std::set uses to sort its arguments. By default it ... comparators with Rust's container types? 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 using cargo build --release to build my project in release configuration and cargo test to build and run my ... this be done using cargo? 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 create a struct to manipulate file storage, but after I change the value it can not be ... the variable continues to be None. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
995 views
1 answer
    I want to have a structure on the heap with two references; one for me and another from a closure. Note ... so everything will work as expected. 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 build a tree-like data structure using the Node representation: use std::cmp::Ordering; use ... having the overhead of enums? 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 create an iterator trait that provides a specific type of resource, so I can implement multiple source ... what am I doing wrong? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    I'm trying to create a struct that has a BufWriter that uses the Write trait, so that this struct could ... should be possible to do somehow. 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 trying to use the functions from one file with multiple other files. When I try adding 'mod somefile' to the ... zzz.rs, src/bbb/zzz.rs). 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 trying to write a container for objects of type T which provides access to references &T to the stored ... example (without copying x)? 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 update a node of a tree structure. A node which is to be updated is selected randomly. To sample a node ... !("{:?}", tree); } 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 going through the build script documentation and was wondering if I can pass any argument to the script ... arguments from command line? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    I need to allocate a buffer for reading from a File, but this buffer must be aligned to the size of ... issues (like launching an instruction). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
921 views
1 answer
    I'm trying understand the ... syntax. Consider the following program: fn how_many(x: i32) -> &'static ... not possible to use within println. 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 having trouble understanding the relationship between the lifetimes on this code. Basically, I have a ... the deserialized value properly? 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 on chapter 12 of The Rust Programming Language, where a case insensitive line search is implemented. It doesn't make sense ... ^^^^^^^^^^^^^ See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
992 views
1 answer
    In C, it's common to assign and compare in a single expression: n = n_init; do { func(n); } while ... some better/different way to express it. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    When defining a generic struct, is there a way in Rust to use different implementation of a method according to which ... }; s.print_me(); } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    fn main() { let number_list = vec![1, 2, 3, 4, 5]; let n = number_list[0]; let r = ... and a non-reference except taking the reference? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I thought I got the idea of move semantics until this code. fn main() { let v = Data { body: vec![10, 40 ... deref feature, so why is it a move? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
958 views
1 answer
    I have a simple graph that successfully compiles: use std::collections::HashMap; type Key = usize; type ... should I restructure this code? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    This would make it possible to safely iterate over the same element twice, or to hold some state for the ... loop notation. Is that possible? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.6k views
1 answer
    I'd like to convert a tuple of references (which are all references to members of the same struct) to a reference ... given a is of type &Foo. 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

Just Browsing Browsing

[7] html - How to create even cell spacing within a

2.1m questions

2.1m answers

60 comments

57.0k users

...