These are chat archives for rust-lang/rust

20th
Nov 2018
Félix Fischer
@felix91gr
Nov 20 2018 02:21
hi again
do any of y'all know of an alternative to the crate bnf to generate strings of a grammar?
I'm trying to use it, but it seems my grammar is confusing it and it's taking the longest routes and reaching its recursion limit, maybe I could reorder my grammar but I dunno...
sometimes it works tho, but most of the time it has that problem
Ali Shirvani
@alishir
Nov 20 2018 09:33
Hi all, how can I run a library example and get trace log files?
I see trace! lines in the library but when I run the examples with RUST_LOG=trace cargo run --example <name> I got nothing.
Denis Lisov
@tanriol
Nov 20 2018 09:35
Does this example initialize some logging backend like env_logger?
aohan237
@aohan237
Nov 20 2018 09:41
@1tgr how to transfer error from future? for example, i have a future<item=String,error=Hyper::Error>. but if i chain futures like another future from actixweb, actix_future<item=Httpresponse,error=actix::Error>. ,which use and_then,but it will always shows about expect actix_Error,but found hyper::Error
@tanriol
Ali Shirvani
@alishir
Nov 20 2018 09:42
@tanriol thank, unfortunately no it doesn't.
aohan237
@aohan237
Nov 20 2018 09:43
but it seems that, none of them have support for transfering error from outside crate
@alishir can you show the example code?
@omni-viral
Ali Shirvani
@alishir
Nov 20 2018 09:45
@tanriol I initialized pretty_env_logger as said in crate homepage but I got no result.
Ali Shirvani
@alishir
Nov 20 2018 09:50
problem resolved I set the environment variable locally :(
aohan237
@aohan237
Nov 20 2018 09:53
ok
uncotion
@uncotion
Nov 20 2018 16:45
@alishir : khaste nabashi baradar
laurent bernabé
@loloof64
Nov 20 2018 20:50
Hi everyone : I am trying to use web-view crate, but it fails to compile, because it can't find WebViewBuilder class
//#![windows_subsystem = "windows"]

extern crate web_view;

use web_view::*;

fn main() {
    WebViewBuilder::new()
        .title("Tic Tac Toe app")
        .content(Content::Html(include_str!("../output/index.html")))
        .size(320, 480)
        .resizable(false)
        .debug(false)
        .user_data(())
        .invoke_handler(|_webview, _arg| Ok(()))
        .build()
        .expect("Failed to build webview !")
        .run()
        .expect("Failed to run application !");
}
So, what's wrong with that ? I am some code from the official examples.
My cargo.toml
[package]
name = "tictactoe_webview"
version = "0.1.0"
authors = ["Me"]

[dependencies]
web-view = "0.2.1"
Denis Lisov
@tanriol
Nov 20 2018 20:53
The builder-based rewrite will be in the 0.3 release series of web-view
laurent bernabé
@loloof64
Nov 20 2018 20:54
Thanks :) I understand better. So I'll look at older versions of examples
Managed with the following main.rs : thanks again :smile:
//#![windows_subsystem = "windows"]

extern crate web_view;

use web_view::*;

fn main() {
    let size = (320, 480);
    let resizable = false;
    let debug = false;
    let init_cb = |_webview| {};
    let frontend_cb = |_webview: &mut _, _arg: &_, _userdata: &mut _| {};
    let userdata = ();
    let html = include_str!("../output/index.html");
    run("Tic Tac Toe App", Content::Html(html), Some(size), resizable, debug, init_cb, frontend_cb, userdata);
}
laurent bernabé
@loloof64
Nov 20 2018 21:06
Does someone know how can I interact with Rust "backend" ? I did not find such an example in the repository.
Steve Cirner
@scirner_gitlab
Nov 20 2018 21:07
Anyone with a lot of actix knowledge? I'm seeing a bug where my web routes aren't sharing the same AppState as some actors inside a websocket route.