iscsi-client-rs 0.0.3

A pure-Rust iSCSI initiator library and CLI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
bitflags::bitflags! {
    #[derive(Default, Debug, PartialEq)]
    pub struct StageFlags: u8 {
        const FINAL     = 0x80; // bit7
        const CONTINUE  = 0x40; // bit6
    }
}

impl TryFrom<u8> for StageFlags {
    type Error = anyhow::Error;

    fn try_from(value: u8) -> Result<Self, Self::Error> {
        StageFlags::from_bits(value)
            .ok_or_else(|| anyhow::anyhow!("invalid DataOutFlags: {:#08b}", value))
    }
}