These are chat archives for rust-lang/rust

23rd
Dec 2018
Ali Shirvani
@alishir
Dec 23 2018 06:13
sorry for cross posting, I have two futures that both will be resolve to a SipMessage, the type of one of them is future::FutureResult and the type of other is future::Map. I read the docs and both types implemented Future trait, how can I create a vector that contains both of these futures?
Here is the simplified code block:
      let ring_fut = future::ok::<_, io::Error>(SipMessage::Response(res));
      let res_fut = some_stream.filter().collect().map(|v| SipMessage::Response(create_response(v)));
>>    let vec_fut = vec![ring_fut, res_fut];
the type of ring_fut is future::FutureResult and the type of res_fut is future::FutureMap
Ali Shirvani
@alishir
Dec 23 2018 06:18
and the Future trait implemented for both types according to docs.
Tim Robinson
@1tgr
Dec 23 2018 09:19
Wrap each of them in future::Either
Or box them
Ali Shirvani
@alishir
Dec 23 2018 09:20
Thanks @1tgr , I finally boxed them
Ali Shirvani
@alishir
Dec 23 2018 10:39
How can I convert &u32 to u16
I used u16::from(*u32) but doesn't help
Ali Shirvani
@alishir
Dec 23 2018 10:45
Is it possible to set system time from rust code, in windows?
Ali Shirvani
@alishir
Dec 23 2018 11:20
I want to set the time programatically in Windows 7
Tim Robinson
@1tgr
Dec 23 2018 12:56
Ali Shirvani
@alishir
Dec 23 2018 12:57
@1tgr thanks, I thinks so.
bekraoui
@bekraoui
Dec 23 2018 15:54

hello, i'm new to Rust & gfx-rs, i' want to render to a texture and use that texture as an image to imgui , after several houres :-) i have created a texture using factory.view_texture_as_render_target successufully but i don't know how to use it as texture in imgui; ( ps : i have done this once using c++ as https://gamedev.stackexchange.com/questions/140693/how-can-i-render-an-opengl-scene-into-an-imgui-window?rq=1 )

actualy that's what i want to do, and i tried it but it doesen't work. It seams the textures are not considered the same type(or mybe i did it the wrong way: as i'm beginner to rust), i would apreciate if take a look on the pastbin below , maybe you can give me other sugestion.
Ps: in c++ it uses pointers. But in rust i'm not very used to the typing system
Thank you

https://pastebin.com/RHGkpq7z

it is based on this exemple : https://github.com/WimbledonLabs/imgui_gfx_example
thank you
David McGillicuddy
@djmcgill
Dec 23 2018 16:48
Is there a list somewhere of nightly feature flags? I'm keen to try existential types (and/or impl in traits) but despite having browsed their RFCs I can't work out their current state in nightly.
Tim Robinson
@1tgr
Dec 23 2018 18:33
David O'Connor
@David-OConnor
Dec 23 2018 19:20
Has anyone here gotten wasm_bindgen's fetch API working?
David McGillicuddy
@djmcgill
Dec 23 2018 19:22
thanks @1tgr