Skip to main content

ScsiCommandRequestBuilder

Struct ScsiCommandRequestBuilder 

Source
pub struct ScsiCommandRequestBuilder {
    pub header: ScsiCommandRequest,
    /* private fields */
}
Expand description

Builder for constructing iSCSI SCSI Command Request PDUs

Provides methods to build and serialize SCSI Command Request PDUs with proper digest handling and data segment management.

Fields§

§header: ScsiCommandRequest

The SCSI command request header structure

Implementations§

Source§

impl ScsiCommandRequestBuilder

Source

pub fn new() -> Self

Creates a new ScsiCommandRequestBuilder with default values.

Source

pub fn immediate(self) -> Self

Sets the Immediate bit in the PDU header.

Source

pub fn read(self) -> Self

Sets the Read bit in the PDU header.

Source

pub fn write(self) -> Self

Sets the Write bit in the PDU header.

Source

pub fn task_attribute(self, task: TaskAttribute) -> Self

Sets the task attribute for the SCSI command.

Source

pub fn with_header_digest(self) -> Self

Enables header digest for the PDU.

Source

pub fn with_data_digest(self) -> Self

Enables data digest for the PDU.

Source

pub fn initiator_task_tag(self, tag: u32) -> Self

Sets the initiator task tag, a unique identifier for this command.

Source

pub fn expected_data_transfer_length(self, expected_data_length: u32) -> Self

Sets the expected data transfer length for the command.

Source

pub fn cmd_sn(self, sn: u32) -> Self

Sets the command sequence number (CmdSN) for this request.

Source

pub fn exp_stat_sn(self, sn: u32) -> Self

Sets the expected status sequence number (ExpStatSN) from the target.

Source

pub fn lun(self, lun: u64) -> Self

Sets the Logical Unit Number (LUN) for the command.

Source

pub fn scsi_descriptor_block(self, scsi_descriptor_block: &[u8; 16]) -> Self

Sets the SCSI Command Descriptor Block (CDB).

Trait Implementations§

Source§

impl Debug for ScsiCommandRequestBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScsiCommandRequestBuilder

Source§

fn default() -> ScsiCommandRequestBuilder

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ScsiCommandRequestBuilder

Source§

fn eq(&self, other: &ScsiCommandRequestBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ScsiCommandRequestBuilder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more