^(Hello everyone!,)
^(I am still a beginner but I am trying to understand sentences using Mirinae (my goal is not to speak, but to be able to parse and understand sentences in books using a dictionary. I am trying to translate this sentence:)
^(그곳에열심히 산 사람들의 숨결도 위대한 사랑을 위해 목숨을 버린 사람도 깨달음을 위해 무든 것을버린 현자도 살아 있는 듯, 우리 곁으로 다가온다.)
^(If I am correct, I can more or less split it up into multiple parts:)
^(1. 그곳에열심히 산 사람들의 숨결도)
^(2. 위대한 사랑을 위해 목숨을 버린 사람도)
^(3. 깨달음을 위해 무든 것을버린 현자도)
^(4. 살아 있는 듯, 우리 곁으로 다가온다.)
^(I feel I can more or less follow along with most parts of the sentence, except for the second part. What I do not understand is this 목숨을 버린 사람도.)
^(1. 목숨을 - Life (+ object ma
CrystalDev
u/CrystalDev
Hello everyone,
I am currently working on a Certificate Transparency log scraper using HTTP2.
Now the problem that I run into is that if I create too many tasks (20+ network IO tasks) the first ones will await at some point during task but will never get called again to finish because other (newly) spawned tasks seem to be prioritized. When looking at tokio's docs I was not able to figure out what kind of scheduling algorithm Tokio uses and if the user can somehow change this.
I hope someone would be able to give me some pointers! The code is listed in the Tokio issue mentioned below.
Thanks in advance!
References:
- [Reddit: Getting HTTP2 to work with h2 and the new async-aw
Hello everyone,
I am going to apologize for the amount of code I am going to post in advance. I have been struggling for the past 2 weeks on setting up an HTTP2 connection using h2. I tried to follow the Akamai example in the h2 folder and I could get the example working. But I'd like to try the new async syntax so I tried my best on converting the example:
My code so far:
#![feature(async_await)]
use tokio::net::TcpStream;
use std::sync::Arc;
use webpki::DNSNameRef;
use futures::compat::Future01CompatExt;
use futures::future::{FutureExt, TryFutureExt};
use h2::client;
use rustls::ClientConfig;
use tokio_rustls::ClientConfigExt;
use rustls
Hello everyone,
I have been trying to learn Rust for a couple of months now and I am finally coming to understand more and more of the language (still think it's great). However, one thing that I just fail to understand is why the Rust std does not contain functionality for reading primitive types. Of course, we have the Read trait which enables us to read bytes (much like Java's InputStream but then only for reading bytes). But why is there no functionality to read u32 or i64 from Read? I know that we have the byteorder crate which extends the Read trait to do such operations, however, reading primitive types feels like such a basic operation that one would suspect such functio
Hello everyone, I have been using Rust for about 3 months now and I still love the language. One of the things I hit into was the From and Into traits. I have seen 3 uses of these traits:
1, Either create function signatures using From:
fn add<A, B>(a: A, b: B) -> u32 where u32: From<A> + From<B>
{
u32::from(a) + u32::from(b)
}
2, Using function signatures using Into:
fn add<A, B>(a: A, b: B) -> u32 where A: Into<u32>, B: Into<u32>
{
a.into() + b.into()
}
3, or by not using them at all and let the caller do the work:
fn main()
{
let a: u8 = 5;
let b: u16 = 4;
add(a.into(), b.into());
}
fn add(a: u32, b: u32)
Hello everyone,
Since about 2 months I have been working on some projects. It made me wonder how people handle different Cargo/Crates.io versions in interaction with Git.
For example: Let's say I currently have a project version 1.0.0 and multiple people are working on it at the same time. Would they then all increment it to 1.0.1 on their specific branch / Pull Request? That would mean that if one PR would be merged others would automatically have to be updated with new numbers.
Or would a better approach be to use 1.0.0 for all Pull Requests and then do a different commit on master when the newly merged PR would together form 1.0.1? This however then would mean that the master branch (
Hello everyone!,
When I joined this reddit I was still a beginner in Rust, and after a month or two I still pretty much feel like a beginner but with the main difference that I was actually able to create my first library. mrt-rs is a parser for Multi-threaded Routed Toolkit (MRT) formatted files.
The GitHub repo can be found here.
There has however been a challenge that I am not sure how to tackle:
How do you guys know when a Read stream has been completely read? Currently I do something like this:
// Read the entire contents of the File in a buffer.
let mut buffer: Vec<u8> = vec![];
readable.read_to_end(&mut buffer).unwrap();
let lengt
Hello everyone,
I hope this is not a stupid question but I was wondering about the following.
I'd like to achieve the following:
struct MyStruct<A, B, C, M> { map: M<A, C<B>>; }
Such that I can do something like: MyStruct<i32, i32, Vec, HashMap>. The idea is that the user of the struct is able to pick the map and collection that is most efficient for his uses.
For as far as I know we cannot pass generics as Type Arguments. Is there any way around this without too much overhead?
I apologize for once again probably asking a noob question but I was wondering the following:
The Rust Reference says that a slice is a DST, but my impression always was that a slice is simply an (address, length) pair which should be a fixed size at runtime right? Or am I already talking about a reference to a slice here and is the slice itself the memory that occupies a part of the array? If this was the case, then a &[T] would not be a "normal" address since it also contains a length right?
I hope you all understand my confusion :)
I've been looking at Rust for about a week now, reading it's documentation in order to get a good overview of the features present and I came upon this: https://doc.rust-lang.org/reference/items/functions.html#function-attributes
It says that it is possible to declare an attribute inside the body and that it applies to the function as a whole, but that " Except for lints, it is idiomatic to only use outer attributes on function items."
So I was wondering: Can someone give me a concrete example of when placing such attributes inside the function block makes more sense then doing it with outer attributes?
You've reached the end of this feed.