Skip to main content

Decode

Trait Decode 

Source
pub trait Decode: Sized {
    const COMMAND: u16;

    // Required method
    fn decode(frame: &[u8]) -> Result<Self, Status>;
}
Expand description

Decode one single-command SMB2 frame into a typed request. Implemented per command; dispatched statically by SmbRequest::parse.

Required Associated Constants§

Source

const COMMAND: u16

The SMB2 command code this request decodes.

Required Methods§

Source

fn decode(frame: &[u8]) -> Result<Self, Status>

Parse the request from its complete frame (header + body); the frame is borrowed, so payloads stay zero-copy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Decode for ChangeNotifyReq

Source§

const COMMAND: u16 = cmd::CHANGE_NOTIFY

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for CloseReq

Source§

const COMMAND: u16 = cmd::CLOSE

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for CreateReq

Source§

const COMMAND: u16 = cmd::CREATE

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for FlushReq

Source§

const COMMAND: u16 = cmd::FLUSH

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for IoctlReq

Source§

const COMMAND: u16 = cmd::IOCTL

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for LockReq

Source§

const COMMAND: u16 = cmd::LOCK

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for QueryDirReq

Source§

const COMMAND: u16 = cmd::QUERY_DIRECTORY

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for QueryInfoReq

Source§

const COMMAND: u16 = cmd::QUERY_INFO

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for ReadReq

Source§

const COMMAND: u16 = cmd::READ

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for SetInfoReq

Source§

const COMMAND: u16 = cmd::SET_INFO

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Source§

impl Decode for WriteReq

Source§

const COMMAND: u16 = cmd::WRITE

Source§

fn decode(frame: &[u8]) -> Result<Self, Status>

Implementors§

Source§

impl Decode for CancelReq

Source§

const COMMAND: u16 = cmd::CANCEL

Source§

impl Decode for EchoReq

Source§

const COMMAND: u16 = cmd::ECHO

Source§

impl Decode for LogoffReq

Source§

const COMMAND: u16 = cmd::LOGOFF

Source§

impl Decode for NegotiateReq

Source§

const COMMAND: u16 = cmd::NEGOTIATE

Source§

impl Decode for OplockBreakReq

Source§

const COMMAND: u16 = cmd::OPLOCK_BREAK

Source§

impl Decode for SessionSetupReq

Source§

const COMMAND: u16 = cmd::SESSION_SETUP

Source§

impl Decode for TreeConnectReq

Source§

const COMMAND: u16 = cmd::TREE_CONNECT

Source§

impl Decode for TreeDisconnectReq

Source§

const COMMAND: u16 = cmd::TREE_DISCONNECT