Skip to main content

Op

Enum Op 

Source
#[non_exhaustive]
pub enum Op {
Show 37 variants Connect, Sync, Transact(Command), Run(String), List, Path, Cd(Vec<String>), Updir, Mkdir(String), Remove(String), Rename { from: String, to: String, }, Mem, Version, Model, Iopar, SetIopar(Iopar), TransferMode, SetTransferMode(TransferMode), Get { name: String, mode: TransferMode, }, Put { name: String, data: Vec<u8>, mode: TransferMode, }, Pict, PictFile, Backup, Restore(Vec<u8>), RestoreLeaving { data: Vec<u8>, mode: TransferMode, }, PurgeRestoreLeftover, Finish, PrepareXmodem { direction: XmodemDirection, name: String, }, XmodemSend { data: Vec<u8>, options: XmodemOptions, }, XmodemReceive { options: XmodemOptions, }, XservProbe(Duration), XservList, XservMemory, XservExecute(String), XservGet { name: String, options: XmodemOptions, }, XservPut { name: String, data: Vec<u8>, options: XmodemOptions, }, XservQuit,
}
Expand description

One operation of a Machine; each is the Calculator or XmodemSession method of the same name, and its result is the Reply variant named.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Connect

Discard input for Options::drain (stale NAKs of the idle server), then Op::Sync: the start of every connection. Reply::Done.

§

Sync

§

Transact(Command)

One raw Kermit transaction. Reply::Transcript.

§

Run(String)

A host command. Reply::Stack.

§

List

§

Path

§

Cd(Vec<String>)

Change to an absolute directory path. Reply::Done.

§

Updir

§

Mkdir(String)

§

Remove(String)

§

Rename

Fields

§from: String

The existing name.

§to: String

The new name, which must not exist.

§

Mem

Free memory. Reply::Real.

§

Version

§

Model

§

Iopar

§

SetIopar(Iopar)

§

TransferMode

§

SetTransferMode(TransferMode)

§

Get

GET a variable. Reply::Data.

Fields

§name: String

The variable name.

§mode: TransferMode

The transfer mode.

§

Put

SEND a variable. Reply::Stored.

Fields

§name: String

The variable name.

§data: Vec<u8>

The file contents.

§mode: TransferMode

The transfer mode.

§

Pict

§

PictFile

PICT as the binary transfer file the calculator sent (a GROB). Reply::Data.

§

Backup

§

Restore(Vec<u8>)

§

RestoreLeaving

Op::Restore with flag -35 set to mode just before RESTORE (the calculator keeps its flags through it). Reply::Done.

Fields

§data: Vec<u8>

The backup.

§mode: TransferMode

The transfer mode the calculator is left in.

§

PurgeRestoreLeftover

§

Finish

End server mode (G F). Reply::Done.

§

PrepareXmodem

Fields

§direction: XmodemDirection

Which way the transfer goes.

§name: String

The variable name.

§

XmodemSend

Send a file to a calculator running XRECV. Reply::XmodemSent.

Fields

§data: Vec<u8>

The file.

§options: XmodemOptions

The XModem options (see XmodemOptions::for_model).

§

XmodemReceive

Receive a file from a calculator running XSEND. Reply::XmodemReceived.

Fields

§options: XmodemOptions

The XModem options (see XmodemOptions::for_model).

§

XservProbe(Duration)

XSERV: send M once and wait this long for the answer (see xserv::memory_reply). Reply::XservProbe.

§

XservList

§

XservMemory

XSERV M. Reply::Real.

§

XservExecute(String)

XSERV E: run RPL text; nothing comes back. Reply::Done.

§

XservGet

XSERV G, then XModem. Reply::XmodemReceived.

Fields

§name: String

The variable, in the current directory.

§options: XmodemOptions

The XModem options (see xserv::transfer_options).

§

XservPut

XSERV P, then XModem. Reply::XmodemSent.

Fields

§name: String

The variable name.

§data: Vec<u8>

The file.

§options: XmodemOptions

The XModem options (see xserv::transfer_options).

§

XservQuit

XSERV Q, then M once. Reply::XservQuit.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Self

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 Op

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Op

§

impl Freeze for Op

§

impl Move for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.