scsir

Crates.ioscsir
lib.rsscsir
version0.2.0
sourcesrc
created_at2023-03-31 18:24:18.084333
updated_at2024-08-04 04:58:50.7697
descriptionA simple library for issuing SCSI commands
homepage
repositoryhttps://github.com/maboroshinokiseki/scsir
max_upload_size
id826637
size569,539
(maboroshinokiseki)

documentation

https://docs.rs/scsir

README

SCSIR

A simple library for issuing SCSI commands.

Example

fn main() -> scsir::Result<()> {
    // Open a scsi device
    let scsi = scsir::Scsi::new("/dev/sdX")?;

    // Issue a simple command
    scsi.test_unit_ready().issue()?;

    // Issue a command with parameters(fields)
    scsi.read()
        .logical_block_address(0)
        .logical_block_size(512)
        .transfer_length(1)
        .issue_16()?;

    // Issue a command with data out buffer parameters
    scsi.verify()
        .byte_check(0b01)
        .logical_block_address(0)
        .parameter(&[0; 512])
        .issue_16()?;
}
Commit count: 1

cargo fmt