lawless-m/iscsi-crate ? reverse-engineered prompt
Reverse engineered prompt
Build me a pure Rust iSCSI target library that I can plug my own storage into.
I want it to speak the full basic iSCSI flow, including login, logout, discovery, normal sessions, and the common SCSI block commands like read, write, inquiry, capacity, test unit ready, sense, report luns, verify, and cache sync. It should let me implement a simple storage backend with a trait, then run a target server on a chosen address and port. Please include support for one way and mutual CHAP authentication, and make the write path handle immediate data and multi PDU transfers.
Add a few simple examples, one with in memory storage, one with CHAP, and one for discovery. Also include tests that prove it works with the expected protocol behavior, and if you need to, look up current docs online for iSCSI details. I’d like the code to be clean, reusable, and easy to use from a small Rust app.
Are you gonna build this?
make sure you review the code using coderabbit