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
    While raw pointers in Rust have the offset method, this only increments by the size of the pointer. How can I get ... char *)(var) + offset); See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
839 views
1 answer
    I wrote a function to titlecase (first letter capitalized, all others lowercase) a borrowed String, but it ended ... String contents by index? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    Given the following struct and impl: use std::slice::Iter; use std::cell::RefCell; struct Foo { bar: ... to return and use bars iterator? 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 the following function that's supposed to find and return the longest length of a String given an Iterator ... I iterate over my strings? 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 a Rust async server based on the Tokio runtime. It has to process a mix of latency-sensitive I/O- ... an isolated CPU pool in Tokio? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
822 views
1 answer
    In Rust, a panic terminates the current thread but is not sent back to the main thread. The solution we are ... achieve Rust behavior in Go). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
947 views
1 answer
    I read this code: pub fn up_to(limit: u64) -> impl Generator<Yield = u64, Return = u64> { move || { for ... be implemented in plain Rust or C++? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
804 views
1 answer
    According to the docs for Option, Option is an enum with variants Some<T> and None. Why is it possible to ... variant, struct or const `Bar` See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
745 views
1 answer
    I have something that implements std::iter::Iterator and I want to know if there are > 0 elements. What is ... sight what I'm checking here? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
917 views
1 answer
    It is possible to write constructions like this: enum Number { One = 1, Two = 2, Three = 3, Four = 4, } ... to get the value of an enum variant. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
984 views
1 answer
    I'm using the example code on elastic search's blog post about their new crate and I'm unable to get ... { block_on(elastic_search_example()); } 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 a struct that contains children of its own type. These children are wrapped in Arcs, and I'm getting ... is more important at this point. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
987 views
1 answer
    Given the code below, how can I specifically check for EOF? Or rather, how can I distinguish between "there's ... _) => do_something_else(), } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I'd like to create an Rc<str> because I want reduce the indirection from following the 2 pointers that accessing ... or String to str anyway). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
912 views
1 answer
    I'm on a project interacting with files, and I would like to use text files to test my work. However tests ... 't find anything attesting it)? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I'd like to make the following code compile: struct Provider {} impl Provider { fn get_string<'a>(&'a self) -> &'a str ... = |s: &str| { | ^^^ See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
966 views
1 answer
    I have a type: struct Foo { memberA: Bar, memberB: Baz, } and a pointer which I know is a pointer to ... as I know has no offsetof macro. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
912 views
1 answer
    I have found a case where manually inlining a function changes the way the borrow-checker treats it, such ... combining all four versions. 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 trying to return the values of a vector: fn merge<'a>(left: &'a [i32], right: &'a [i32]) -> [i32] ... I can't find out how to 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
    When attempting to run a program that builds a large clap::App (find the source here), I get a stackoverflow: thread ... -27) (built 2015-04-28) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
924 views
1 answer
    I'm writing a system where I have a collection of Objects, and each Object has a unique integral ID. Here' ... number hither and yon. Thoughts? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
872 views
1 answer
    Using the enum Axes to confine Coordinate and Quaternion: #[derive(Clone)] pub enum Axes { Coordinate { x: f64, y ... to use and in what cases. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
676 views
1 answer
    It seems that the default behavior of Cargo when searching for its configuration directory is to look in ... user-supplied directory instead? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
890 views
1 answer
    This code fails the dreaded borrow checker (playground): struct Data { a: i32, b: i32, c: i32, } impl Data ... ? Is there a way around it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
901 views
1 answer
    I'm using watch with cargo, in order to quickly see compile time errors. However, cargo build will only show ... always give me the warnings? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
922 views
1 answer
    I want to implement a builder similar to the debug builders defined by the standard library. They are defined ... can I find it documented? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
621 views
1 answer
    I'm writing a future combinator that needs to consume a value that it was provided with. With futures 0.1, ... this operation in a safe manner? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
795 views
1 answer
    The Display trait is defined as follows: pub trait Display { fn fmt(&self, &mut Formatter) -> Result<(), Error> ... What is it and its purpose? 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

...