Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 26 variants Use { namespace: Option<String>, database: Option<String>, }, Signup { credentials: Object, }, Signin { credentials: Object, }, Authenticate { token: Token, }, Refresh { token: Token, }, Invalidate, Begin, Rollback { txn: Uuid, }, Commit { txn: Uuid, }, Revoke { token: Token, }, Query { txn: Option<Uuid>, query: Cow<'static, str>, variables: Variables, }, ExportFile { path: PathBuf, config: Option<DbExportConfig>, }, ExportMl { path: PathBuf, config: MlExportConfig, }, ExportBytes { bytes: Sender<Result<Vec<u8>, Error>>, config: Option<DbExportConfig>, }, ExportBytesMl { bytes: Sender<Result<Vec<u8>, Error>>, config: MlExportConfig, }, ImportFile { path: PathBuf, }, ImportMl { path: PathBuf, }, Health, Version, Set { key: String, value: Value, }, Unset { key: String, }, SubscribeLive { uuid: Uuid, notification_sender: Sender<Result<Notification, Error>>, }, Kill { uuid: Uuid, }, Attach { session_id: Uuid, }, Detach { session_id: Uuid, }, Run { name: String, version: Option<String>, args: Array, },
}
Expand description

The operations an engine can be asked to perform.

Variants§

§

Use

Select the namespace and/or database for the session.

Fields

§namespace: Option<String>

The namespace to use, or None to leave it unchanged.

§database: Option<String>

The database to use, or None to leave it unchanged.

§

Signup

Sign up as a record user and authenticate the session.

Fields

§credentials: Object

The signup credentials.

§

Signin

Sign in and authenticate the session.

Fields

§credentials: Object

The signin credentials.

§

Authenticate

Authenticate the session with an existing token.

Fields

§token: Token

The token to authenticate with.

§

Refresh

Exchange a refresh token for a fresh token pair.

Fields

§token: Token

The token carrying the refresh token.

§

Invalidate

Drop the session’s authentication.

§

Begin

Begin a manual transaction.

§

Rollback

Cancel a manual transaction.

Fields

§txn: Uuid

The transaction to cancel.

§

Commit

Commit a manual transaction.

Fields

§txn: Uuid

The transaction to commit.

§

Revoke

Invalidate a refresh token so it can no longer be redeemed.

Fields

§token: Token

The token carrying the refresh token.

§

Query

Execute a query, optionally inside a manual transaction.

Fields

§txn: Option<Uuid>

The transaction to run in, or None for an implicit one.

§query: Cow<'static, str>

The query text.

§variables: Variables

The variables bound for this query only.

§

ExportFile

Export the database to a file.

Fields

§path: PathBuf

The file to write.

§config: Option<DbExportConfig>

What to include in the export.

§

ExportMl

Export a machine learning model to a file.

Fields

§path: PathBuf

The file to write.

§config: MlExportConfig

The model to export.

§

ExportBytes

Export the database to a channel.

Fields

§bytes: Sender<Result<Vec<u8>, Error>>

Where the export is streamed.

§config: Option<DbExportConfig>

What to include in the export.

§

ExportBytesMl

Export a machine learning model to a channel.

Fields

§bytes: Sender<Result<Vec<u8>, Error>>

Where the export is streamed.

§config: MlExportConfig

The model to export.

§

ImportFile

Import a database export from a file.

Fields

§path: PathBuf

The file to read.

§

ImportMl

Import a machine learning model from a file.

Fields

§path: PathBuf

The file to read.

§

Health

Check that the engine is reachable.

§

Version

Report the database version.

§

Set

Set a session variable.

Fields

§key: String

The variable name.

§value: Value

The value to bind, or Value::None to remove it.

§

Unset

Remove a session variable.

Fields

§key: String

The variable name.

§

SubscribeLive

Register the channel a live query’s notifications are delivered on.

Fields

§uuid: Uuid

The live query.

§notification_sender: Sender<Result<Notification, Error>>

Where notifications are delivered.

§

Kill

Kill a live query.

Fields

§uuid: Uuid

The live query.

§

Attach

Adopt an existing remote session.

Fields

§session_id: Uuid

The session to adopt.

§

Detach

Release a remote session without ending it.

Fields

§session_id: Uuid

The session to release.

§

Run

Call a function or a machine learning model.

Fields

§name: String

The function or model name.

§version: Option<String>

The model version, if any.

§args: Array

The arguments to pass.

Trait Implementations§

Source§

impl Clone for Command

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 Command

Source§

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

Formats the value using the given formatter. 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool