Skip to main content

Request

Enum Request 

Source
pub enum Request {
Show 15 variants Hello, Stat { path: String, }, List { path: String, offset: u32, limit: u32, }, Read { path: String, offset: u64, len: u32, }, Write { path: String, data: Vec<u8>, }, Append { path: String, data: Vec<u8>, }, Mkdir { path: String, parents: bool, }, Rename { from: String, to: String, }, Delete { path: String, recursive: bool, }, Replace { from: String, to: String, }, Realpath { path: String, }, SetMeta { path: String, mode: u32, mtime_ms: i64, }, Sync { path: String, }, Procs { top: u32, filter: String, }, PaneProcs { block_id: String, session: String, },
}
Expand description

What a request asks for.

Variants§

§

Hello

The handshake: answered with Reply::Hello.

§

Stat

Fields

§path: String
§

List

Up to limit entries of a directory from offset, sorted by name.

Fields

§path: String
§offset: u32
§limit: u32
§

Read

Up to len bytes from offset (at most MAX_READ).

Fields

§path: String
§offset: u64
§len: u32
§

Write

Replace the file with data, atomically: a temp file beside it, synced, then renamed over it, keeping an existing file’s mode.

Fields

§path: String
§data: Vec<u8>
§

Append

Add data to the end of an existing file (at most MAX_WRITE): a big upload, a piece at a time, into a temp file that is then renamed into place. Never creates the file.

Fields

§path: String
§data: Vec<u8>
§

Mkdir

Fields

§path: String
§parents: bool
§

Rename

Fields

§from: String
§

Delete

Fields

§path: String
§recursive: bool
§

Replace

Rename the file from over the file to in one step: what was at to is gone only once from is there (never a folder, either side).

Fields

§from: String
§

Realpath

path with every link and .. resolved: Reply::Path.

Fields

§path: String
§

SetMeta

Give a file its permission bits (mode, 0 to leave them) and its modification time (mtime_ms, 0 to leave it).

Fields

§path: String
§mode: u32
§mtime_ms: i64
§

Sync

Flush a file’s contents to disk (before a moved source goes).

Fields

§path: String
§

Procs

The host’s processes for Tower (crate::procs): the top busiest by CPU and the top largest by memory among those whose name or PID matches every word of filter. Reply::Procs.

Fields

§top: u32
§filter: String
§

PaneProcs

What one AgentMux pane’s processes on this host use, for its stats badge (crate::procs::Sampler::pane): the shell of durable session and what it started, else the processes whose environment holds AGENTMUX_BLOCKID=<block_id>. Either may be empty. Reply::PaneProcs.

Fields

§block_id: String
§session: String

Implementations§

Source§

impl Request

Source

pub fn encode(&self, id: u32) -> Vec<u8> ⓘ

The message for this request, with id.

Source

pub fn decode(body: &[u8]) -> Result<(u32, Request), String>

A request body: its id and the request.

Trait Implementations§

Source§

impl Clone for Request

Source§

fn clone(&self) -> Request

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Eq for Request

Source§

impl PartialEq for Request

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Request

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.