These are chat archives for rust-lang/rust

17th
May 2018
York Xiang
@bombless
May 17 2018 00:56
impl Trait works, kinda like one other place to put your methods.
Brandon Ros
@brandonros
May 17 2018 04:38
@huhlig did you ever ask the guys about rust db2 libraries?
trsh
@trsh
May 17 2018 07:07
#[allow(non_snake_case)]
#[derive(GraphQLObject)]
#[graphql(description = "List")]
pub struct List<T> {
    pub totalCount: i32,
    pub edges: Vec<T>,
}
Im trying to do something like this. But GraphQLObject is complaining about T
No idea how to feed it
Any ideas?
Berkus Decker
@berkus
May 17 2018 07:45
@tandrysyawaludin i think you're overengineering this, should be simpler
trsh
@trsh
May 17 2018 09:06
Never, mind, must ask this in other channel
Dmitriy
@dpogretskiy
May 17 2018 10:39
because it doesn't make any sense
Dmitriy
@dpogretskiy
May 17 2018 10:39
whole that match statement
WaDelma
@WaDelma
May 17 2018 11:05
But I am not using s in the guard.
Which is why I am confused on the error message
How doesn't the match make sense? Take in account that it's reduction from my actual problem.
Denis Lisov
@tanriol
May 17 2018 11:12
@WaDelma A known issue (#45600), see also #47295. This will likely be significantly modified in the NLL (aka MIR borrowck) work.
Farzeen
@thefzsalam
May 17 2018 12:10
what does pub(crate) mean in
pub struct ArgumentList { pub(crate) ptr: *mut *mut *mut libc::c_char, items: Vec<String>, }
Visible in the current crate only is the summary.
Applied to just that one field.
Farzeen
@thefzsalam
May 17 2018 12:46
thanks @ZackPierce :)
Berkus Decker
@berkus
May 17 2018 18:40
Guys, I have a question about owning_ref and if it even will help me
struct Wrapper {
    pool_item: objpool::Item<Vec<u8>>, // owns a buf
    packet: Packet, // refers to pool_item's buf
    builder: Builder, // refers to packet
}
this is obviously not representable - i cannot move into Wrapper.pool_item if i referenced it to create a packet
are there any good solutions?
I tried splitting off pool_item into one structure and packet+builder into another that's temporary
Berkus Decker
@berkus
May 17 2018 18:52
but i'm hitting a variety of obstables, namely, the lifetimes :(
Berkus Decker
@berkus
May 17 2018 19:02
any suggestions welcome
this problem most probably was solved many times before :)
Denis Lisov
@tanriol
May 17 2018 21:10
@berkus The problem of self-referential structs, AFAIK, has no good solution. You may want to look at rental and/or owning_ref crates, still.
ozgurakkurt
@ozgurakkurt
May 17 2018 21:33
Hi, I am trying to send a http response to my browser with tokio. I modified the hello world example to write"HTTP/1.1 200 OK\r\n\r\nhello" but my browser says "The connection to the server was reset while the page was loading.". Sorry for noob question, I am very new to this.
Denis Lisov
@tanriol
May 17 2018 23:02
@ozgurakkurt Your server needs to actually read out the request from the socket, otherwise dropping the socket sends RST (connection reset) instead of FIN (finishing normally).
Closing a socket without reading all the data from it is not considered a clean connection shutdown.
Hans W. Uhlig
@huhlig
May 17 2018 23:49
@brandonros I did but the local group hasn’t written any that they know of yet