RequestContent

Enum RequestContent 

Source
pub enum RequestContent {
Show 20 variants Negotiate(NegotiateRequest), SessionSetup(SessionSetupRequest), Logoff(LogoffRequest), TreeConnect(TreeConnectRequest), TreeDisconnect(TreeDisconnectRequest), Create(CreateRequest), Close(CloseRequest), Flush(FlushRequest), Read(ReadRequest), Write(WriteRequest), Lock(LockRequest), Ioctl(IoctlRequest), Echo(EchoRequest), QueryDirectory(QueryDirectoryRequest), ChangeNotify(ChangeNotifyRequest), QueryInfo(QueryInfoRequest), SetInfo(SetInfoRequest), Cancel(CancelRequest), OplockBreakAck(OplockBreakAck), LeaseBreakAck(LeaseBreakAck),
}
Expand description

Contains all the variants for a plain SMB2 request message.

For example - read/write/create/close requests, etc.

Variants§

Implementations§

Source§

impl RequestContent

Source

pub fn associated_cmd(&self) -> Command

Get the command associated with this content.

Source§

impl RequestContent

Source

pub fn content_name(&self) -> &'static str

Returns the name of the content value.

Source

pub fn to_negotiate(self) -> Result<NegotiateRequest, SmbMsgError>

Attempts to cast the current content type to [negotiate :: NegotiateRequest].

Source

pub fn as_negotiate(&self) -> Result<&NegotiateRequest, SmbMsgError>

Attempts to cast the current content type to [negotiate :: NegotiateRequest].

Source

pub fn as_mut_negotiate(&mut self) -> Result<&mut NegotiateRequest, SmbMsgError>

Attempts to cast the current content type to [negotiate :: NegotiateRequest].

Source

pub fn to_sessionsetup(self) -> Result<SessionSetupRequest, SmbMsgError>

Attempts to cast the current content type to [session_setup :: SessionSetupRequest].

Source

pub fn as_sessionsetup(&self) -> Result<&SessionSetupRequest, SmbMsgError>

Attempts to cast the current content type to [session_setup :: SessionSetupRequest].

Source

pub fn as_mut_sessionsetup( &mut self, ) -> Result<&mut SessionSetupRequest, SmbMsgError>

Attempts to cast the current content type to [session_setup :: SessionSetupRequest].

Source

pub fn to_logoff(self) -> Result<LogoffRequest, SmbMsgError>

Attempts to cast the current content type to [session_setup :: LogoffRequest].

Source

pub fn as_logoff(&self) -> Result<&LogoffRequest, SmbMsgError>

Attempts to cast the current content type to [session_setup :: LogoffRequest].

Source

pub fn as_mut_logoff(&mut self) -> Result<&mut LogoffRequest, SmbMsgError>

Attempts to cast the current content type to [session_setup :: LogoffRequest].

Source

pub fn to_treeconnect(self) -> Result<TreeConnectRequest, SmbMsgError>

Attempts to cast the current content type to [tree_connect :: TreeConnectRequest].

Source

pub fn as_treeconnect(&self) -> Result<&TreeConnectRequest, SmbMsgError>

Attempts to cast the current content type to [tree_connect :: TreeConnectRequest].

Source

pub fn as_mut_treeconnect( &mut self, ) -> Result<&mut TreeConnectRequest, SmbMsgError>

Attempts to cast the current content type to [tree_connect :: TreeConnectRequest].

Source

pub fn to_treedisconnect(self) -> Result<TreeDisconnectRequest, SmbMsgError>

Attempts to cast the current content type to [tree_connect :: TreeDisconnectRequest].

Source

pub fn as_treedisconnect(&self) -> Result<&TreeDisconnectRequest, SmbMsgError>

Attempts to cast the current content type to [tree_connect :: TreeDisconnectRequest].

Source

pub fn as_mut_treedisconnect( &mut self, ) -> Result<&mut TreeDisconnectRequest, SmbMsgError>

Attempts to cast the current content type to [tree_connect :: TreeDisconnectRequest].

Source

pub fn to_create(self) -> Result<CreateRequest, SmbMsgError>

Attempts to cast the current content type to [create :: CreateRequest].

Source

pub fn as_create(&self) -> Result<&CreateRequest, SmbMsgError>

Attempts to cast the current content type to [create :: CreateRequest].

Source

pub fn as_mut_create(&mut self) -> Result<&mut CreateRequest, SmbMsgError>

Attempts to cast the current content type to [create :: CreateRequest].

Source

pub fn to_close(self) -> Result<CloseRequest, SmbMsgError>

Attempts to cast the current content type to [create :: CloseRequest].

Source

pub fn as_close(&self) -> Result<&CloseRequest, SmbMsgError>

Attempts to cast the current content type to [create :: CloseRequest].

Source

pub fn as_mut_close(&mut self) -> Result<&mut CloseRequest, SmbMsgError>

Attempts to cast the current content type to [create :: CloseRequest].

Source

pub fn to_flush(self) -> Result<FlushRequest, SmbMsgError>

Attempts to cast the current content type to [file :: FlushRequest].

Source

pub fn as_flush(&self) -> Result<&FlushRequest, SmbMsgError>

Attempts to cast the current content type to [file :: FlushRequest].

Source

pub fn as_mut_flush(&mut self) -> Result<&mut FlushRequest, SmbMsgError>

Attempts to cast the current content type to [file :: FlushRequest].

Source

pub fn to_read(self) -> Result<ReadRequest, SmbMsgError>

Attempts to cast the current content type to [file :: ReadRequest].

Source

pub fn as_read(&self) -> Result<&ReadRequest, SmbMsgError>

Attempts to cast the current content type to [file :: ReadRequest].

Source

pub fn as_mut_read(&mut self) -> Result<&mut ReadRequest, SmbMsgError>

Attempts to cast the current content type to [file :: ReadRequest].

Source

pub fn to_write(self) -> Result<WriteRequest, SmbMsgError>

Attempts to cast the current content type to [file :: WriteRequest].

Source

pub fn as_write(&self) -> Result<&WriteRequest, SmbMsgError>

Attempts to cast the current content type to [file :: WriteRequest].

Source

pub fn as_mut_write(&mut self) -> Result<&mut WriteRequest, SmbMsgError>

Attempts to cast the current content type to [file :: WriteRequest].

Source

pub fn to_lock(self) -> Result<LockRequest, SmbMsgError>

Attempts to cast the current content type to [lock :: LockRequest].

Source

pub fn as_lock(&self) -> Result<&LockRequest, SmbMsgError>

Attempts to cast the current content type to [lock :: LockRequest].

Source

pub fn as_mut_lock(&mut self) -> Result<&mut LockRequest, SmbMsgError>

Attempts to cast the current content type to [lock :: LockRequest].

Source

pub fn to_ioctl(self) -> Result<IoctlRequest, SmbMsgError>

Attempts to cast the current content type to [ioctl :: IoctlRequest].

Source

pub fn as_ioctl(&self) -> Result<&IoctlRequest, SmbMsgError>

Attempts to cast the current content type to [ioctl :: IoctlRequest].

Source

pub fn as_mut_ioctl(&mut self) -> Result<&mut IoctlRequest, SmbMsgError>

Attempts to cast the current content type to [ioctl :: IoctlRequest].

Source

pub fn to_echo(self) -> Result<EchoRequest, SmbMsgError>

Attempts to cast the current content type to [echo :: EchoRequest].

Source

pub fn as_echo(&self) -> Result<&EchoRequest, SmbMsgError>

Attempts to cast the current content type to [echo :: EchoRequest].

Source

pub fn as_mut_echo(&mut self) -> Result<&mut EchoRequest, SmbMsgError>

Attempts to cast the current content type to [echo :: EchoRequest].

Source

pub fn to_querydirectory(self) -> Result<QueryDirectoryRequest, SmbMsgError>

Attempts to cast the current content type to [query_dir :: QueryDirectoryRequest].

Source

pub fn as_querydirectory(&self) -> Result<&QueryDirectoryRequest, SmbMsgError>

Attempts to cast the current content type to [query_dir :: QueryDirectoryRequest].

Source

pub fn as_mut_querydirectory( &mut self, ) -> Result<&mut QueryDirectoryRequest, SmbMsgError>

Attempts to cast the current content type to [query_dir :: QueryDirectoryRequest].

Source

pub fn to_changenotify(self) -> Result<ChangeNotifyRequest, SmbMsgError>

Attempts to cast the current content type to [notify :: ChangeNotifyRequest].

Source

pub fn as_changenotify(&self) -> Result<&ChangeNotifyRequest, SmbMsgError>

Attempts to cast the current content type to [notify :: ChangeNotifyRequest].

Source

pub fn as_mut_changenotify( &mut self, ) -> Result<&mut ChangeNotifyRequest, SmbMsgError>

Attempts to cast the current content type to [notify :: ChangeNotifyRequest].

Source

pub fn to_queryinfo(self) -> Result<QueryInfoRequest, SmbMsgError>

Attempts to cast the current content type to [info :: QueryInfoRequest].

Source

pub fn as_queryinfo(&self) -> Result<&QueryInfoRequest, SmbMsgError>

Attempts to cast the current content type to [info :: QueryInfoRequest].

Source

pub fn as_mut_queryinfo(&mut self) -> Result<&mut QueryInfoRequest, SmbMsgError>

Attempts to cast the current content type to [info :: QueryInfoRequest].

Source

pub fn to_setinfo(self) -> Result<SetInfoRequest, SmbMsgError>

Attempts to cast the current content type to [info :: SetInfoRequest].

Source

pub fn as_setinfo(&self) -> Result<&SetInfoRequest, SmbMsgError>

Attempts to cast the current content type to [info :: SetInfoRequest].

Source

pub fn as_mut_setinfo(&mut self) -> Result<&mut SetInfoRequest, SmbMsgError>

Attempts to cast the current content type to [info :: SetInfoRequest].

Source

pub fn to_cancel(self) -> Result<CancelRequest, SmbMsgError>

Attempts to cast the current content type to [cancel :: CancelRequest].

Source

pub fn as_cancel(&self) -> Result<&CancelRequest, SmbMsgError>

Attempts to cast the current content type to [cancel :: CancelRequest].

Source

pub fn as_mut_cancel(&mut self) -> Result<&mut CancelRequest, SmbMsgError>

Attempts to cast the current content type to [cancel :: CancelRequest].

Source

pub fn to_oplockbreakack(self) -> Result<OplockBreakAck, SmbMsgError>

Attempts to cast the current content type to [oplock :: OplockBreakAck].

Source

pub fn as_oplockbreakack(&self) -> Result<&OplockBreakAck, SmbMsgError>

Attempts to cast the current content type to [oplock :: OplockBreakAck].

Source

pub fn as_mut_oplockbreakack( &mut self, ) -> Result<&mut OplockBreakAck, SmbMsgError>

Attempts to cast the current content type to [oplock :: OplockBreakAck].

Source

pub fn to_leasebreakack(self) -> Result<LeaseBreakAck, SmbMsgError>

Attempts to cast the current content type to [oplock :: LeaseBreakAck].

Source

pub fn as_leasebreakack(&self) -> Result<&LeaseBreakAck, SmbMsgError>

Attempts to cast the current content type to [oplock :: LeaseBreakAck].

Source

pub fn as_mut_leasebreakack( &mut self, ) -> Result<&mut LeaseBreakAck, SmbMsgError>

Attempts to cast the current content type to [oplock :: LeaseBreakAck].

Source§

impl RequestContent

Source

pub fn req_payload_size(&self) -> u32

If this is a request has a payload, it returns the size of it. Otherwise, it returns 0.

This method shall be used for calculating credits request & charge.

Source

pub fn expected_resp_size(&self) -> u32

If this is a request that expects a response with size, it returns that expected size.

This method shall be used for calculating credits request & charge.

Trait Implementations§

Source§

impl BinRead for RequestContent

Source§

type Args<'__binrw_generated_args_lifetime> = (&'__binrw_generated_args_lifetime Command,)

The type used for the args parameter of read_args() and read_options(). Read more
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>

Read Self from the reader using the given Endian and arguments. Read more
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments. Read more
Source§

fn read_be<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming big-endian byte order. Read more
Source§

fn read_le<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming little-endian byte order. Read more
Source§

fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read T from the reader assuming native-endian byte order. Read more
Source§

fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian,

Read Self from the reader using the given arguments. Read more
Source§

fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming big-endian byte order, using the given arguments. Read more
Source§

fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming little-endian byte order, using the given arguments. Read more
Source§

fn read_ne_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read T from the reader, assuming native-endian byte order, using the given arguments. Read more
Source§

impl BinWrite for RequestContent

Source§

type Args<'__binrw_generated_args_lifetime> = (&'__binrw_generated_args_lifetime Command,)

The type used for the args parameter of write_args() and write_options(). Read more
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<()>

Write Self to the writer using the given Endian and arguments. Read more
Source§

fn write<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self: WriteEndian, Self::Args<'a>: for<'a> Required,

Write Self to the writer using default arguments. Read more
Source§

fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self::Args<'a>: for<'a> Required,

Write Self to the writer assuming big-endian byte order. Read more
Source§

fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self::Args<'a>: for<'a> Required,

Write Self to the writer assuming little-endian byte order. Read more
Source§

fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self::Args<'a>: for<'a> Required,

Write Self to the writer assuming native-endian byte order. Read more
Source§

fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek, Self: WriteEndian,

Write Self to the writer using the given arguments. Read more
Source§

fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek,

Write Self to the writer, assuming big-endian byte order, using the given arguments. Read more
Source§

fn write_le_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek,

Write Self to the writer, assuming little-endian byte order, using the given arguments. Read more
Source§

fn write_ne_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek,

Write Self to the writer, assuming native-endian byte order, using the given arguments. Read more
Source§

impl Debug for RequestContent

Source§

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

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

impl From<CancelRequest> for RequestContent

Source§

fn from(req: CancelRequest) -> Self

Converts to this type from the input type.
Source§

impl From<ChangeNotifyRequest> for RequestContent

Source§

fn from(req: ChangeNotifyRequest) -> Self

Converts to this type from the input type.
Source§

impl From<CloseRequest> for RequestContent

Source§

fn from(req: CloseRequest) -> Self

Converts to this type from the input type.
Source§

impl From<CreateRequest> for RequestContent

Source§

fn from(req: CreateRequest) -> Self

Converts to this type from the input type.
Source§

impl From<EchoMessage> for RequestContent

Source§

fn from(req: EchoRequest) -> Self

Converts to this type from the input type.
Source§

impl From<FlushRequest> for RequestContent

Source§

fn from(req: FlushRequest) -> Self

Converts to this type from the input type.
Source§

impl From<IoctlRequest> for RequestContent

Source§

fn from(req: IoctlRequest) -> Self

Converts to this type from the input type.
Source§

impl From<LockRequest> for RequestContent

Source§

fn from(req: LockRequest) -> Self

Converts to this type from the input type.
Source§

impl From<LogoffRequest> for RequestContent

Source§

fn from(req: LogoffRequest) -> Self

Converts to this type from the input type.
Source§

impl From<NegotiateRequest> for RequestContent

Source§

fn from(req: NegotiateRequest) -> Self

Converts to this type from the input type.
Source§

impl From<QueryDirectoryRequest> for RequestContent

Source§

fn from(req: QueryDirectoryRequest) -> Self

Converts to this type from the input type.
Source§

impl From<QueryInfoRequest> for RequestContent

Source§

fn from(req: QueryInfoRequest) -> Self

Converts to this type from the input type.
Source§

impl From<ReadRequest> for RequestContent

Source§

fn from(req: ReadRequest) -> Self

Converts to this type from the input type.
Source§

impl From<SessionSetupRequest> for RequestContent

Source§

fn from(req: SessionSetupRequest) -> Self

Converts to this type from the input type.
Source§

impl From<SetInfoRequest> for RequestContent

Source§

fn from(req: SetInfoRequest) -> Self

Converts to this type from the input type.
Source§

impl From<TreeConnectRequest> for RequestContent

Source§

fn from(req: TreeConnectRequest) -> Self

Converts to this type from the input type.
Source§

impl From<TreeDisconnectRequest> for RequestContent

Source§

fn from(req: TreeDisconnectRequest) -> Self

Converts to this type from the input type.
Source§

impl From<WriteRequest> for RequestContent

Source§

fn from(req: WriteRequest) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RequestContent

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 ReadEndian for RequestContent

Source§

const ENDIAN: EndianKind

The endianness of the type.
Source§

impl WriteEndian for RequestContent

Source§

const ENDIAN: EndianKind

The endianness of the type.
Source§

impl Eq for RequestContent

Source§

impl StructuralPartialEq for RequestContent

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V