pub struct TextResponse {
pub opcode: RawBhsOpcode,
pub flags: RawStageFlags,
pub total_ahs_length: u8,
pub data_segment_length: [u8; 3],
pub lun: LogicalUnitNumber,
pub initiator_task_tag: InitiatorTaskTag,
pub target_task_tag: TargetTaskTag,
pub stat_sn: U32<BigEndian>,
pub exp_cmd_sn: U32<BigEndian>,
pub max_cmd_sn: U32<BigEndian>,
/* private fields */
}Expand description
Represents the Basic Header Segment (BHS) for a Text Response PDU.
Fields§
§opcode: RawBhsOpcode§flags: RawStageFlags§total_ahs_length: u8§data_segment_length: [u8; 3]§lun: LogicalUnitNumber§initiator_task_tag: InitiatorTaskTag§target_task_tag: TargetTaskTag§stat_sn: U32<BigEndian>§exp_cmd_sn: U32<BigEndian>§max_cmd_sn: U32<BigEndian>Implementations§
Source§impl TextResponse
impl TextResponse
Sourcepub fn to_bhs_bytes(&self, buf: &mut [u8]) -> Result<()>
pub fn to_bhs_bytes(&self, buf: &mut [u8]) -> Result<()>
Serializes the BHS into a byte buffer.
Sourcepub fn from_bhs_bytes(buf: &mut [u8]) -> Result<&mut Self>
pub fn from_bhs_bytes(buf: &mut [u8]) -> Result<&mut Self>
Deserializes the BHS from a byte buffer.
Trait Implementations§
Source§impl BasicHeaderSegment for TextResponse
impl BasicHeaderSegment for TextResponse
fn to_bhs_bytes(&self, buf: &mut [u8]) -> Result<()>
Source§fn get_opcode(&self) -> Result<BhsOpcode>
fn get_opcode(&self) -> Result<BhsOpcode>
first u8 of BHS
Source§fn get_initiator_task_tag(&self) -> u32
fn get_initiator_task_tag(&self) -> u32
Expose Initiator Task Tag of this PDU
Source§fn get_ahs_length_bytes(&self) -> usize
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, len: u8)
fn set_ahs_length_bytes(&mut self, len: u8)
Number of extra AHS bytes (always a multiple of 4).
Source§fn get_data_length_bytes(&self) -> usize
fn get_data_length_bytes(&self) -> usize
Get number of actual payload bytes in the DataSegment.
Source§fn set_data_length_bytes(&mut self, len: u32)
fn set_data_length_bytes(&mut self, len: u32)
Set number of actual payload bytes in the DataSegment.
Source§fn total_length_bytes(&self) -> usize
fn total_length_bytes(&self) -> usize
Number of actual payload bytes in the DataSegment.
fn get_header_diggest(&self, enable_header_digest: bool) -> usize
fn get_data_diggest(&self, enable_data_digest: bool) -> usize
Source§impl Debug for TextResponse
impl Debug for TextResponse
Source§impl Default for TextResponse
impl Default for TextResponse
Source§fn default() -> TextResponse
fn default() -> TextResponse
Returns the “default value” for a type. Read more
Source§impl<'a> From<&'a mut TextResponse> for Pdu<'a>
impl<'a> From<&'a mut TextResponse> for Pdu<'a>
Source§fn from(v: &'a mut TextResponse) -> Pdu<'a>
fn from(v: &'a mut TextResponse) -> Pdu<'a>
Converts to this type from the input type.
Source§impl FromBytes for TextResponsewhere
RawBhsOpcode: FromBytes,
RawStageFlags: FromBytes,
[u8; 2]: FromBytes,
u8: FromBytes,
[u8; 3]: FromBytes,
LogicalUnitNumber: FromBytes,
InitiatorTaskTag: FromBytes,
TargetTaskTag: FromBytes,
U32<BigEndian>: FromBytes,
[u8; 12]: FromBytes,
impl FromBytes for TextResponsewhere
RawBhsOpcode: FromBytes,
RawStageFlags: FromBytes,
[u8; 2]: FromBytes,
u8: FromBytes,
[u8; 3]: FromBytes,
LogicalUnitNumber: FromBytes,
InitiatorTaskTag: FromBytes,
TargetTaskTag: FromBytes,
U32<BigEndian>: FromBytes,
[u8; 12]: FromBytes,
Source§fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
Interprets the suffix of the given bytes as a
&Self. Read moreSource§fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§fn ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
Source§fn ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
Source§fn ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
Source§fn mut_from_bytes_with_elems(
source: &mut [u8],
count: usize,
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
fn mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
Source§fn mut_from_prefix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
fn mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
Source§fn mut_from_suffix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
fn mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
Source§impl FromBytes for TextResponse
impl FromBytes for TextResponse
Source§impl FromZeros for TextResponsewhere
RawBhsOpcode: FromZeros,
RawStageFlags: FromZeros,
[u8; 2]: FromZeros,
u8: FromZeros,
[u8; 3]: FromZeros,
LogicalUnitNumber: FromZeros,
InitiatorTaskTag: FromZeros,
TargetTaskTag: FromZeros,
U32<BigEndian>: FromZeros,
[u8; 12]: FromZeros,
impl FromZeros for TextResponsewhere
RawBhsOpcode: FromZeros,
RawStageFlags: FromZeros,
[u8; 2]: FromZeros,
u8: FromZeros,
[u8; 3]: FromZeros,
LogicalUnitNumber: FromZeros,
InitiatorTaskTag: FromZeros,
TargetTaskTag: FromZeros,
U32<BigEndian>: FromZeros,
[u8; 12]: FromZeros,
impl Immutable for TextResponsewhere
RawBhsOpcode: Immutable,
RawStageFlags: Immutable,
[u8; 2]: Immutable,
u8: Immutable,
[u8; 3]: Immutable,
LogicalUnitNumber: Immutable,
InitiatorTaskTag: Immutable,
TargetTaskTag: Immutable,
U32<BigEndian>: Immutable,
[u8; 12]: Immutable,
Source§impl IntoBytes for TextResponsewhere
RawBhsOpcode: IntoBytes,
RawStageFlags: IntoBytes,
[u8; 2]: IntoBytes,
u8: IntoBytes,
[u8; 3]: IntoBytes,
LogicalUnitNumber: IntoBytes,
InitiatorTaskTag: IntoBytes,
TargetTaskTag: IntoBytes,
U32<BigEndian>: IntoBytes,
[u8; 12]: IntoBytes,
(): PaddingFree<Self, { _ }>,
impl IntoBytes for TextResponsewhere
RawBhsOpcode: IntoBytes,
RawStageFlags: IntoBytes,
[u8; 2]: IntoBytes,
u8: IntoBytes,
[u8; 3]: IntoBytes,
LogicalUnitNumber: IntoBytes,
InitiatorTaskTag: IntoBytes,
TargetTaskTag: IntoBytes,
U32<BigEndian>: IntoBytes,
[u8; 12]: IntoBytes,
(): PaddingFree<Self, { _ }>,
Source§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
Source§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl KnownLayout for TextResponse
impl KnownLayout for TextResponse
Source§type PointerMetadata = <[u8; 12] as KnownLayout>::PointerMetadata
type PointerMetadata = <[u8; 12] as KnownLayout>::PointerMetadata
The type of metadata stored in a pointer to
Self. Read moreSource§fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
Computes the size of an object of type
Self with the given pointer
metadata. Read moreSource§impl PartialEq for TextResponse
impl PartialEq for TextResponse
Source§fn eq(&self, other: &TextResponse) -> bool
fn eq(&self, other: &TextResponse) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl SendingData for TextResponse
impl SendingData for TextResponse
Source§fn get_final_bit(&self) -> bool
fn get_final_bit(&self) -> bool
Return the current state of the Final (F) bit.
Source§fn set_final_bit(&mut self)
fn set_final_bit(&mut self)
Force F = 1 (and, if your PDU has it, clear C).
Source§fn get_continue_bit(&self) -> bool
fn get_continue_bit(&self) -> bool
Return the current state of the Continue (C) bit.
Source§fn set_continue_bit(&mut self)
fn set_continue_bit(&mut self)
Force C = 1 (and clear F).
impl StructuralPartialEq for TextResponse
Source§impl TryFromBytes for TextResponsewhere
RawBhsOpcode: TryFromBytes,
RawStageFlags: TryFromBytes,
[u8; 2]: TryFromBytes,
u8: TryFromBytes,
[u8; 3]: TryFromBytes,
LogicalUnitNumber: TryFromBytes,
InitiatorTaskTag: TryFromBytes,
TargetTaskTag: TryFromBytes,
U32<BigEndian>: TryFromBytes,
[u8; 12]: TryFromBytes,
impl TryFromBytes for TextResponsewhere
RawBhsOpcode: TryFromBytes,
RawStageFlags: TryFromBytes,
[u8; 2]: TryFromBytes,
u8: TryFromBytes,
[u8; 3]: TryFromBytes,
LogicalUnitNumber: TryFromBytes,
InitiatorTaskTag: TryFromBytes,
TargetTaskTag: TryFromBytes,
U32<BigEndian>: TryFromBytes,
[u8; 12]: TryFromBytes,
Source§fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
Source§fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
Source§fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
Source§fn try_ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
Source§fn try_ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
Attempts to interpret the prefix of the given
source as a &Self with
a DST length equal to count. Read moreSource§fn try_ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
Attempts to interpret the suffix of the given
source as a &Self with
a DST length equal to count. Read moreSource§fn try_mut_from_bytes_with_elems(
source: &mut [u8],
count: usize,
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
Source§fn try_mut_from_prefix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
Attempts to interpret the prefix of the given
source as a &mut Self
with a DST length equal to count. Read moreSource§fn try_mut_from_suffix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
Attempts to interpret the suffix of the given
source as a &mut Self
with a DST length equal to count. Read moreSource§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§impl<'a> TryInto<&'a mut TextResponse> for Pdu<'a>
impl<'a> TryInto<&'a mut TextResponse> for Pdu<'a>
impl ZeroCopyType for TextResponse
Auto Trait Implementations§
impl Freeze for TextResponse
impl RefUnwindSafe for TextResponse
impl Send for TextResponse
impl Sync for TextResponse
impl Unpin for TextResponse
impl UnsafeUnpin for TextResponse
impl UnwindSafe for TextResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more