Struct open_protocol::command::Command [] [src]

pub struct Command {
    pub arg: CommandArgs,
    pub set: CmdSet,
    pub enc: u8,
    pub session_id: Option<u8>,
    pub seq: u16,
}

For building a commnd frame.

Example

use open_protocol::command::{Command, CmdSet, Activation};
use open_protocol::types::{CommandArgs};

use std::io::Cursor;

let version_data = CommandArgs::version();
let key = b"abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca";

let mut cmd = Command::new(CmdSet::Activation(Activation::Version), version_data, false, 1);
cmd.set_session_id(3);

let mut buf = Cursor::new(Vec::new());
cmd.write(&mut buf, key).unwrap();

Fields

command args

command set

whether the command is encoded

command session id

command sequence

Methods

impl Command
[src]

Trait Implementations

impl Clone for Command
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Command
[src]

Formats the value using the given formatter.