Rust quick dev httpc – Fail fast !

One of my favourite YouTube coders is Jeremy Chone.

Rust Axum Full Course – Web Development

One thing I want to capture here, for my own use, so I have it ready to copy and paste is the “quick dev”


use anyhow::Result;

async fn quick_dev() -> Result<()>{
    let hc = httpc_test::new_client("http://localhost:8080")?;

anyhow = "1"
httpc-test = "0.1.1"
├── src
│   └──
├── target
│   ├── debug
│   └── tmp
└── tests
cargo watch -q -c -w src/ -x run
cargo watch -q -c -w tests/ -x "test -q quick_dev -- --nocapture"

Query Params in Axum

Line 19 :

handler_hello(Query(params: HelloParams):Query<HelloParams>)

Be sure to add :

 use axum::extract::Query; 

TMUX – restore session on reboot

The cargo commands are quite a lot to remember so save your session in TMUX by adding the vim/nvim plugin to restore the session.

prefix ctrl s – save

prefix ctrl r – restore

My prefix is “ctrl a” but the standard prefix is “ctrl b”

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
set -g @plugin 'tmux-plugins/tmux-resurrect'

run-shell ~/clone/path/resurrect.tmux

tmux-resurrect :