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.1k views
1 answer
    I'm trying to read some lines from a file, skipping the first few and printing the rest, but I keep getting ... not implement the `Copy` trait See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
869 views
1 answer
    I'm trying to learn Rust, but the only thing I do is keep hitting the wall trying to shoehorn familiar (to me) ... in Rust (at least for me). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    My project A depends on library B that depends on library C. Library B sets the dependency version to "* ... sure it will compile successfully. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
944 views
1 answer
    Is it possible to define a constant in source code that can be overridden by a compiler flag? That is, ... MAX_DIMENSIONS: usize = 100_000; See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
905 views
1 answer
    My understanding is that enum is like union in C and the system will allocate the largest of the data types in the ... but E2 takes up 16 bytes? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
873 views
1 answer
    With the following code (an attempt to make an HTTP request using the reqwest crate), the compiler says that ... ::IntoUrl` for `SID_URI` See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
847 views
1 answer
    I want to build a function that splits a list into two: one list that contains the elements of the original ... , but apparently it doesn't. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I am trying to code an Excel-like data structure: use std::collections::HashMap; struct Excel { columns: ... understand what's going on? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    If I try to iterate over a slice twice, it works fine: let a = &[1, 2, 3]; for i in a { ... example fails. Why does the first example succeed? 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 a struct with a BufStream<T> where T: Read+Write. The BufStream can be a TcpStream and I'd like to read ... there a nice way to do that? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.6k views
1 answer
    I am attempting to write the cat command to learn Rust, but I can't seem to convert command line arguments into ... File or Stdin as a reader? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
966 views
1 answer
    Editor's note: This code no longer produces the same error after RFC 599 was implemented, but the concepts discussed in ... -13 20:36:02 +0000) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    Consider the following example: struct S { a: String, b: String, } I have a macro which is called like ... maybe I'm missing something obvious. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
804 views
1 answer
    I know this from RFC 246: constants declare constant values. These represent a value, not a memory address. This ... Which one should I choose? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
758 views
1 answer
    Given the following struct: struct Vector3D { x: f32, y: f32, z: f32 } I want to overload its * ... vice versa for the other implementation. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
832 views
1 answer
    From the std::cell documentation, I see that Cell is "only compatible with types that implement Copy". This means I ... }", cell.count()); } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    I want to run an executable that blocks on stdin and when a key is pressed that same character is printed immediately ... not simple in C/C++. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    Is there a good way to convert a Vec<T> with size S to an array of type [T; S]? Specifically, I ... copying each element, and returns the array? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
750 views
1 answer
    Dave Herman's recent talk in Rust said that they borrowed this property from C++. I couldn't ... please explain what monomorphisation means? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
717 views
1 answer
    I am trying to write a Rust function that is similar to the built-in Range, but I want something that will return ... `T` found type `{integer}` See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
656 views
1 answer
    Is there a way to perform an index access to an instance of a struct like this: struct MyStruct { // ... } impl ... ; // This is what I need } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
851 views
1 answer
    I am using a HashMap to store an enum. I'd like to get a value from the HashMap and if the value is a ... that I can get a new mutable borrow? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
828 views
1 answer
    I tried to implement own analogue of find_or_insert method that looks like this: use std::collections::HashMap; ... work around such situations? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
667 views
1 answer
    Please consider the following minimal example in Rust: const FOOBAR: usize = 3; trait Foo { const BAR: usize; ... compile-time constant size, N. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
997 views
1 answer
    I started a new project, where I want to be as modular as possible, by that I mean that I would like to be ... could do to to make it work. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
931 views
1 answer
    Is there a way for me to obtain a static borrowed reference to a struct's implementation of a trait: trait ... invoke f passing in instance2? } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
645 views
1 answer
    I am trying to write a simple TV-episode file renamer in Rust. A filename is parsed, and might be one of ... a good way to structure this? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
772 views
1 answer
    I'm using an enum for polymorphism, similar to the following: enum MyType { Variant1 { a: i32, b: i32 }, ... way to accomplish a similar thing. 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

...