Improve the Rust logger by adhering to idiomatic Rust conventions and
incorporating additional logging levels: warn, debug, and trace.
Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
This implements BtreeNodeIter, and adds it to cmd_list.rs - the next
step in having a full replacement for cmd_list.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This implements opt_set!(), which works exactly the same as the C
version and allows filesystem options to be specified in Rust code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Implement a rust equivalent to bkey_s_c, which uses references with the
correct lifetimes: now cmd_list.rs doesn't need unsafe.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This is a _very_ preliminary rewrite of the cmd_list tool in rust, which
is intended to be a testing ground for a safe interface in Rust to the
core btree interface. This adds rust wrappers for:
bch_fs: provides bch2_fs_open(), bch2_fs_stop
btree_trans: provides bch2_trans_init(), bch2_trans_exit()
btree_iter: provides peek, peek_and_restart, advance
bch_errcode: implements Display (wraps bch2_err_str())
bpos: implements Ord (wraps bpos_cmp())
bkey_s_c: implements Display (wraps bch2_bkey_val_to_text())
and other assorted types.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>