pub struct BhsHeader {
pub opcode: IscsiOpcode,
pub immediate: bool,
pub is_final: bool,
pub flags: u8,
pub total_ahs_length: u8,
pub data_segment_length: u32,
pub lun: u64,
pub initiator_task_tag: u32,
pub specific: [u8; 28],
}Expand description
iSCSI Basic Header Segment (48 bytes, RFC 7143 Section 11.2).
Fields§
§opcode: IscsiOpcodeOpcode (lower 6 bits) + flags (upper 2 bits).
immediate: boolImmediate delivery flag.
is_final: boolFinal PDU flag.
flags: u8Opcode-specific flags byte.
total_ahs_length: u8Total AHS (Additional Header Segments) length in 4-byte words.
data_segment_length: u32Data segment length (24-bit).
lun: u64Logical Unit Number.
initiator_task_tag: u32Initiator Task Tag.
specific: [u8; 28]Opcode-specific fields (bytes 20-47, 28 bytes).
Implementations§
Source§impl BhsHeader
impl BhsHeader
Sourcepub fn new(opcode: IscsiOpcode) -> Self
pub fn new(opcode: IscsiOpcode) -> Self
Create a new BHS for a given opcode.
Sourcepub fn deserialize(data: &[u8]) -> Option<Self>
pub fn deserialize(data: &[u8]) -> Option<Self>
Deserialize BHS from 48 bytes.
Sourcepub fn padded_data_length(&self) -> usize
pub fn padded_data_length(&self) -> usize
Get data segment length including padding to 4-byte boundary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BhsHeader
impl RefUnwindSafe for BhsHeader
impl Send for BhsHeader
impl Sync for BhsHeader
impl Unpin for BhsHeader
impl UnwindSafe for BhsHeader
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)