Request

Enum Request 

Source
pub enum Request {
    ProcessExec {
        id: Uuid,
        command: Vec<String>,
        env: HashMap<String, String>,
        cwd: Option<PathBuf>,
        stdin: Option<Bytes>,
        timeout: Option<u64>,
    },
    FileGet {
        id: Uuid,
        path: PathBuf,
        range: Option<(u64, u64)>,
    },
    FilePut {
        id: Uuid,
        path: PathBuf,
        content: Bytes,
        mode: Option<u32>,
        create_dirs: bool,
    },
    DirList {
        id: Uuid,
        path: PathBuf,
        include_hidden: bool,
        recursive: bool,
    },
    WasmExec {
        id: Uuid,
        module: Bytes,
        input: Bytes,
        timeout: Option<u64>,
    },
    JsonCall {
        id: Uuid,
        method: String,
        params: Bytes,
    },
    Ping {
        id: Uuid,
        timestamp: u64,
    },
    PtyExec {
        id: Uuid,
        command: Vec<String>,
        env: HashMap<String, String>,
        cwd: Option<PathBuf>,
        privilege: Option<PrivilegeEscalation>,
        timeout: Option<u64>,
    },
}
Expand description

Request message types

Variants§

§

ProcessExec

Process execution request

Fields

§id: Uuid

Request ID for correlation

§command: Vec<String>

Command to execute

§env: HashMap<String, String>

Environment variables

§cwd: Option<PathBuf>

Working directory

§stdin: Option<Bytes>

Standard input data

§timeout: Option<u64>

Timeout in seconds

§

FileGet

File get operation

Fields

§id: Uuid

Request ID for correlation

§path: PathBuf

Path to file

§range: Option<(u64, u64)>

Optional byte range (start, end)

§

FilePut

File put operation

Fields

§id: Uuid

Request ID for correlation

§path: PathBuf

Path to file

§content: Bytes

File content

§mode: Option<u32>

File mode (permissions)

§create_dirs: bool

Create parent directories

§

DirList

Directory listing

Fields

§id: Uuid

Request ID for correlation

§path: PathBuf

Directory path

§include_hidden: bool

Include hidden files

§recursive: bool

Recursive listing

§

WasmExec

WASM module execution

Fields

§id: Uuid

Request ID for correlation

§module: Bytes

WASM module bytecode

§input: Bytes

JSON input data

§timeout: Option<u64>

Execution timeout in seconds

§

JsonCall

JSON RPC call

Fields

§id: Uuid

Request ID for correlation

§method: String

Method name

§params: Bytes

JSON parameters

§

Ping

Ping request for health checking

Fields

§id: Uuid

Request ID for correlation

§timestamp: u64

Timestamp

§

PtyExec

PTY process execution with privilege escalation

Fields

§id: Uuid

Request ID for correlation

§command: Vec<String>

Command to execute

§env: HashMap<String, String>

Environment variables

§cwd: Option<PathBuf>

Working directory

§privilege: Option<PrivilegeEscalation>

Privilege escalation method

§timeout: Option<u64>

Execution timeout in seconds

Implementations§

Source§

impl Request

Source

pub fn id(&self) -> Uuid

Get the request ID

Source

pub fn process_exec( command: Vec<String>, env: HashMap<String, String>, cwd: Option<PathBuf>, stdin: Option<Bytes>, timeout: Option<u64>, ) -> Self

Create a process execution request

Source

pub fn file_get(path: PathBuf, range: Option<(u64, u64)>) -> Self

Create a file get request

Source

pub fn file_put( path: PathBuf, content: Bytes, mode: Option<u32>, create_dirs: bool, ) -> Self

Create a file put request

Source

pub fn ping() -> Self

Create a ping request

Trait Implementations§

Source§

impl Clone for Request

Source§

fn clone(&self) -> Request

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Request

Source§

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

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

impl<'de> Deserialize<'de> for Request

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Request

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,