pub struct ScsiDataOutBuilder {
pub header: ScsiDataOut,
/* private fields */
}Expand description
Builder for SCSI Data-Out PDUs (opcode 0x26).
This helper prepares the Basic Header Segment (BHS) for Data-Out and lets the higher layer stream an arbitrary payload split into chunks that respect the negotiated MaxRecvDataSegmentLength (MRDSL).
When the payload is later converted into wire frames (by your
ToBytes/Builder implementation), each chunk will be emitted as a
separate Data-Out PDU with:
- F (Final) = 1 only on the last chunk,
- DataSN increasing sequentially per PDU,
- BufferOffset set to the cumulative number of bytes already sent,
- DataSegmentLength equal to the current chunk size (without padding).
Target Transfer Tag (TTT) semantics:
- For unsolicited / initial burst Data-Out PDUs, use
DEFAULT_TTT = 0xFFFF_FFFF. - For R2T-driven transfers, set the TTT received in the R2T PDU.
You can also request HeaderDigest and/or DataDigest emission; these flags only affect how the final frames are serialized (they do not modify the BHS fields directly).
Fields§
§header: ScsiDataOutImplementations§
Source§impl ScsiDataOutBuilder
impl ScsiDataOutBuilder
Sourcepub const DEFAULT_TTT: u32 = 0xFFFF_FFFF
pub const DEFAULT_TTT: u32 = 0xFFFF_FFFF
The default Target Transfer Tag for unsolicited Data-Out PDUs.
Sourcepub fn initiator_task_tag(self, itt: u32) -> Self
pub fn initiator_task_tag(self, itt: u32) -> Self
Sets the Initiator Task Tag (ITT) for the command.
Sourcepub fn target_transfer_tag(self, ttt: u32) -> Self
pub fn target_transfer_tag(self, ttt: u32) -> Self
Sets the Target Transfer Tag (TTT) for the data transfer.
Sourcepub fn exp_stat_sn(self, sn: u32) -> Self
pub fn exp_stat_sn(self, sn: u32) -> Self
Sets the expected status sequence number (ExpStatSN).
Sourcepub fn data_sn(self, data_sn: u32) -> Self
pub fn data_sn(self, data_sn: u32) -> Self
Sets the Data Sequence Number (DataSN) for this PDU.
Sourcepub fn buffer_offset(self, buffer_offset: u32) -> Self
pub fn buffer_offset(self, buffer_offset: u32) -> Self
Sets the buffer offset for this PDU.
Sourcepub fn with_header_digest(self) -> Self
pub fn with_header_digest(self) -> Self
Enables header digest for the PDU.
Sourcepub fn with_data_digest(self) -> Self
pub fn with_data_digest(self) -> Self
Enables data digest for the PDU.