Skip to main content

Pdu

Enum Pdu 

Source
pub enum Pdu<'a> {
Show 14 variants NopOutRequest(&'a mut NopOutRequest), ScsiCommandRequest(&'a mut ScsiCommandRequest), TextRequest(&'a mut TextRequest), LoginRequest(&'a mut LoginRequest), ScsiDataOut(&'a mut ScsiDataOut), NopInResponse(&'a mut NopInResponse), ScsiCommandResponse(&'a mut ScsiCommandResponse), TextResponse(&'a mut TextResponse), LoginResponse(&'a mut LoginResponse), ScsiDataIn(&'a mut ScsiDataIn), RejectPdu(&'a mut RejectPdu), ReadyToTransfer(&'a mut ReadyToTransfer), LogoutRequest(&'a mut LogoutRequest), LogoutResponse(&'a mut LogoutResponse),
}
Expand description

An enum representing any iSCSI Protocol Data Unit (PDU). This enum dispatches to the BasicHeaderSegment and SendingData traits.

Variants§

§

NopOutRequest(&'a mut NopOutRequest)

§

ScsiCommandRequest(&'a mut ScsiCommandRequest)

§

TextRequest(&'a mut TextRequest)

§

LoginRequest(&'a mut LoginRequest)

§

ScsiDataOut(&'a mut ScsiDataOut)

§

NopInResponse(&'a mut NopInResponse)

§

ScsiCommandResponse(&'a mut ScsiCommandResponse)

§

TextResponse(&'a mut TextResponse)

§

LoginResponse(&'a mut LoginResponse)

§

ScsiDataIn(&'a mut ScsiDataIn)

§

RejectPdu(&'a mut RejectPdu)

§

ReadyToTransfer(&'a mut ReadyToTransfer)

§

LogoutRequest(&'a mut LogoutRequest)

§

LogoutResponse(&'a mut LogoutResponse)

Implementations§

Source§

impl<'a> Pdu<'a>

Source

pub fn from_bhs_bytes(bytes: &'a mut [u8]) -> Result<Self>

Parses a PDU from its Basic Header Segment (BHS) bytes.

Trait Implementations§

Source§

impl<'a> BasicHeaderSegment for Pdu<'a>

Source§

fn get_opcode(&self) -> Result<BhsOpcode>

first u8 of BHS

Source§

fn get_initiator_task_tag(&self) -> u32

Expose Initiator Task Tag of this PDU

Source§

fn get_ahs_length_bytes(&self) -> usize

Number of extra AHS bytes (always a multiple of 4).

Source§

fn set_ahs_length_bytes(&mut self, __enum_dispatch_arg_0: u8)

Number of extra AHS bytes (always a multiple of 4).

Source§

fn get_data_length_bytes(&self) -> usize

Get number of actual payload bytes in the DataSegment.

Source§

fn set_data_length_bytes(&mut self, __enum_dispatch_arg_0: u32)

Set number of actual payload bytes in the DataSegment.

Source§

fn total_length_bytes(&self) -> usize

Number of actual payload bytes in the DataSegment.

Source§

fn to_bhs_bytes(&self, __enum_dispatch_arg_0: &mut [u8]) -> Result<()>

Source§

fn get_header_diggest(&self, __enum_dispatch_arg_0: bool) -> usize

Source§

fn get_data_diggest(&self, __enum_dispatch_arg_0: bool) -> usize

Source§

impl<'a> Debug for Pdu<'a>

Source§

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

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

impl<'a> From<&'a mut LoginRequest> for Pdu<'a>

Source§

fn from(v: &'a mut LoginRequest) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut LoginResponse> for Pdu<'a>

Source§

fn from(v: &'a mut LoginResponse) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut LogoutRequest> for Pdu<'a>

Source§

fn from(v: &'a mut LogoutRequest) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut LogoutResponse> for Pdu<'a>

Source§

fn from(v: &'a mut LogoutResponse) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut NopInResponse> for Pdu<'a>

Source§

fn from(v: &'a mut NopInResponse) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut NopOutRequest> for Pdu<'a>

Source§

fn from(v: &'a mut NopOutRequest) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut ReadyToTransfer> for Pdu<'a>

Source§

fn from(v: &'a mut ReadyToTransfer) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut RejectPdu> for Pdu<'a>

Source§

fn from(v: &'a mut RejectPdu) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut ScsiCommandRequest> for Pdu<'a>

Source§

fn from(v: &'a mut ScsiCommandRequest) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut ScsiCommandResponse> for Pdu<'a>

Source§

fn from(v: &'a mut ScsiCommandResponse) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut ScsiDataIn> for Pdu<'a>

Source§

fn from(v: &'a mut ScsiDataIn) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut ScsiDataOut> for Pdu<'a>

Source§

fn from(v: &'a mut ScsiDataOut) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut TextRequest> for Pdu<'a>

Source§

fn from(v: &'a mut TextRequest) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut TextResponse> for Pdu<'a>

Source§

fn from(v: &'a mut TextResponse) -> Pdu<'a>

Converts to this type from the input type.
Source§

impl<'a> SendingData for Pdu<'a>

Source§

fn get_final_bit(&self) -> bool

Return the current state of the Final (F) bit.

Source§

fn set_final_bit(&mut self)

Force F = 1 (and, if your PDU has it, clear C).

Source§

fn get_continue_bit(&self) -> bool

Return the current state of the Continue (C) bit.

Source§

fn set_continue_bit(&mut self)

Force C = 1 (and clear F).

Source§

impl<'a> TryInto<&'a mut LoginRequest> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut LoginRequest, <Self as TryInto<&'a mut LoginRequest>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut LoginResponse> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut LoginResponse, <Self as TryInto<&'a mut LoginResponse>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut LogoutRequest> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut LogoutRequest, <Self as TryInto<&'a mut LogoutRequest>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut LogoutResponse> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut LogoutResponse, <Self as TryInto<&'a mut LogoutResponse>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut NopInResponse> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut NopInResponse, <Self as TryInto<&'a mut NopInResponse>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut NopOutRequest> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut NopOutRequest, <Self as TryInto<&'a mut NopOutRequest>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut ReadyToTransfer> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut ReadyToTransfer, <Self as TryInto<&'a mut ReadyToTransfer>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut RejectPdu> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut RejectPdu, <Self as TryInto<&'a mut RejectPdu>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut ScsiCommandRequest> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut ScsiCommandRequest, <Self as TryInto<&'a mut ScsiCommandRequest>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut ScsiCommandResponse> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut ScsiCommandResponse, <Self as TryInto<&'a mut ScsiCommandResponse>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut ScsiDataIn> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut ScsiDataIn, <Self as TryInto<&'a mut ScsiDataIn>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut ScsiDataOut> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut ScsiDataOut, <Self as TryInto<&'a mut ScsiDataOut>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut TextRequest> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut TextRequest, <Self as TryInto<&'a mut TextRequest>>::Error>

Performs the conversion.
Source§

impl<'a> TryInto<&'a mut TextResponse> for Pdu<'a>

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<&'a mut TextResponse, <Self as TryInto<&'a mut TextResponse>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Pdu<'a>

§

impl<'a> Freeze for Pdu<'a>

§

impl<'a> RefUnwindSafe for Pdu<'a>

§

impl<'a> Send for Pdu<'a>

§

impl<'a> Sync for Pdu<'a>

§

impl<'a> Unpin for Pdu<'a>

§

impl<'a> UnsafeUnpin for Pdu<'a>

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