Start picker UI

[?]
Jan 13, 2022, 1:40 AM
5Y7ZXB53EMG34VZI5VQIZ77TZKBB4V6BGIILFZ5ZY73QYK4V2YHQC

Dependencies

  • [2] LPVC545K Get the scraper part of this program working
  • [*] HMOBTVJ4 Initialize crate and add expected dependencies
  • [*] AV73DYWQ Initial functions for using sqlite in async environment
  • [*] YCWYAX6K Functions for scraping names integrated enough to test (they don't work yet)
  • [*] KUANIPWF Add function for adding name to database
  • [*] C376NCOV Prevent flooding the website (still need to better mimic browser requests)

Change contents

  • file addition: pick.rs (----------)
    [4.15]
    use crossterm::{
    cursor,
    event::{Event, EventStream},
    style::{self, StyledContent, Stylize},
    QueueableCommand,
    };
    use futures::stream::{self, Stream, StreamExt};
    use crate::DynResult;
    use crate::names_database::AsyncConnection;
    pub async fn pick(db: AsyncConnection, count: u16) -> DynResult<()> {
    Ok(())
    }
    pub fn events() -> (stream::Abortable<EventStream>, stream::AbortHandle) {
    stream::abortable(EventStream::new())
    }
    fn print_pair<A,B>(
    out: &mut impl std::io::Write,
    a: A,
    b: B,
    ) -> std::io::Result<()> where
    A: Stylize<Styled = StyledContent<A>> + std::fmt::Display,
    B: Stylize<Styled = StyledContent<B>> + std::fmt::Display,
    {
    out.queue(style::PrintStyledContent(a.reset()))?
    .queue(style::PrintStyledContent(" ◆ ".grey()))?
    .queue(style::PrintStyledContent(b.reset()))?
    .queue(style::PrintStyledContent(" > ".dark_blue()))?;
    out.flush()?;
    Ok(())
    }
  • edit in src/main.rs at line 5
    [5.2010]
    [6.34]
    mod pick;
  • edit in src/main.rs at line 26
    [2.37]
    [6.337]
    Pick {
    count: u16,
    }
  • edit in src/main.rs at line 47
    [6.779]
    [7.1643]
    Self::Pick { count } => {
    }
  • edit in Cargo.toml at line 10
    [6.923]
    [2.5121]
    crossterm = { version = "^0.22.1", features = ["default","event-stream"] }
    futures = "0.3.19"
  • edit in Cargo.toml at line 21
    [8.278]
  • edit in Cargo.lock at line 156
    [4.2760]
    [4.2760]
    name = "crossterm"
    version = "0.22.1"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "c85525306c4291d1b73ce93c8acf9c339f9b213aef6c1d85c3830cbf1c16325c"
    dependencies = [
    "bitflags",
    "crossterm_winapi",
    "futures-core",
    "libc",
    "mio",
    "parking_lot",
    "signal-hook",
    "signal-hook-mio",
    "winapi",
    ]
    [[package]]
    name = "crossterm_winapi"
    version = "0.9.0"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c"
    dependencies = [
    "winapi",
    ]
    [[package]]
  • edit in Cargo.lock at line 296
    [4.5550]
    [4.5550]
    ]
    [[package]]
    name = "futures"
    version = "0.3.19"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4"
    dependencies = [
    "futures-channel",
    "futures-core",
    "futures-executor",
    "futures-io",
    "futures-sink",
    "futures-task",
    "futures-util",
  • edit in Cargo.lock at line 320
    [4.5786]
    [4.5786]
    "futures-sink",
  • edit in Cargo.lock at line 328
    [4.5985]
    [4.5985]
    [[package]]
    name = "futures-executor"
    version = "0.3.19"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a"
    dependencies = [
    "futures-core",
    "futures-task",
    "futures-util",
    ]
    [[package]]
    name = "futures-io"
    version = "0.3.19"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2"
  • edit in Cargo.lock at line 347
    [4.5998]
    [4.5998]
    name = "futures-macro"
    version = "0.3.19"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c"
    dependencies = [
    "proc-macro2",
    "quote",
    "syn",
    ]
    [[package]]
  • edit in Cargo.lock at line 375
    [4.6593]
    [4.6593]
    "futures-channel",
  • edit in Cargo.lock at line 377
    [4.6610]
    [4.6610]
    "futures-io",
    "futures-macro",
    "futures-sink",
  • edit in Cargo.lock at line 381
    [4.6627]
    [4.6627]
    "memchr",
  • edit in Cargo.lock at line 384
    [4.6662]
    [4.6662]
    "slab",
  • edit in Cargo.lock at line 704
    [6.1975]
    [4.13992]
    "crossterm",
    "futures",
  • edit in Cargo.lock at line 1315
    [2.8018]
    [4.26184]
    [[package]]
    name = "signal-hook"
    version = "0.3.13"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d"
    dependencies = [
    "libc",
    "signal-hook-registry",
    ]
  • edit in Cargo.lock at line 1327
    [4.26197]
    [4.26197]
    name = "signal-hook-mio"
    version = "0.2.1"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "29fd5867f1c4f2c5be079aee7a2adf1152ebb04a4bc4d341f504b7dece607ed4"
    dependencies = [
    "libc",
    "mio",
    "signal-hook",
    ]
    [[package]]
    name = "signal-hook-registry"
    version = "1.4.0"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
    dependencies = [
    "libc",
    ]
    [[package]]