pub struct WriteRequest {
pub structure_size: u16,
pub data_offset: u16,
pub length: u32,
pub offset: u64,
pub file_id: FileId,
pub channel: u32,
pub remaining_bytes: u32,
pub write_channel_info_offset: u16,
pub write_channel_info_length: u16,
pub flags: u32,
pub data: Vec<u8>,
}Expand description
SMB2_WRITE_REQUEST (MS-SMB2 §2.2.21).
Fields§
§structure_size: u16§data_offset: u16§length: u32§offset: u64§file_id: FileId§channel: u32§remaining_bytes: u32§write_channel_info_offset: u16§write_channel_info_length: u16§flags: u32§data: Vec<u8>length bytes at data_offset, counted from the start of the SMB2
header and not before the end of the fixed fields. Empty when
length is 0.
Implementations§
Source§impl WriteRequest
impl WriteRequest
Sourcepub const STANDARD_DATA_OFFSET: u16 = 0x70
pub const STANDARD_DATA_OFFSET: u16 = 0x70
Canonical DataOffset placing the data buffer immediately after the
fixed 48-byte WRITE prefix: 64 (SMB2 header) + 48 = 112 = 0x70.
Sourcepub const FLAG_WRITE_THROUGH: u32 = 0x0000_0001
pub const FLAG_WRITE_THROUGH: u32 = 0x0000_0001
Flag: SMB2_WRITEFLAG_WRITE_THROUGH.
Sourcepub const FLAG_WRITE_UNBUFFERED: u32 = 0x0000_0002
pub const FLAG_WRITE_UNBUFFERED: u32 = 0x0000_0002
Flag: SMB2_WRITEFLAG_WRITE_UNBUFFERED (3.0.2+).
pub fn parse(buf: &[u8]) -> Result<Self, ProtoError>
pub fn write_to(&self, out: &mut Vec<u8>) -> Result<(), ProtoError>
Trait Implementations§
Source§impl BinRead for WriteRequest
impl BinRead for WriteRequest
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
Read
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for WriteRequest
impl BinWrite for WriteRequest
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer using default arguments. Read moreSource§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming little-endian byte order. Read moreSource§fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming native-endian byte order. Read moreSource§fn write_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Write
Self to the writer using the given arguments. Read moreSource§fn write_be_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Write
Self to the writer, assuming big-endian byte order, using the
given arguments. Read moreSource§impl Clone for WriteRequest
impl Clone for WriteRequest
Source§impl Debug for WriteRequest
impl Debug for WriteRequest
impl Eq for WriteRequest
Source§impl PartialEq for WriteRequest
impl PartialEq for WriteRequest
Source§impl ReadEndian for WriteRequest
impl ReadEndian for WriteRequest
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
impl StructuralPartialEq for WriteRequest
Source§impl WriteEndian for WriteRequest
impl WriteEndian for WriteRequest
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
Auto Trait Implementations§
impl Forget for WriteRequest
impl Freeze for WriteRequest
impl Move for WriteRequest
impl RefUnwindSafe for WriteRequest
impl Send for WriteRequest
impl Sync for WriteRequest
impl Unpin for WriteRequest
impl UnsafeUnpin for WriteRequest
impl UnwindSafe for WriteRequest
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