Skip to main content

Command

Enum Command 

Source
pub enum Command {
    Serve {
        db_dir: PathBuf,
        addr: SocketAddr,
        ui: ServeUi,
        demo_if_empty: bool,
        token: Option<String>,
        snapshot_every: Option<Duration>,
    },
    Mcp {
        db_dir: PathBuf,
    },
    Stats {
        db_dir: PathBuf,
    },
    Demo {
        db_dir: PathBuf,
    },
    AsOf {
        db_dir: PathBuf,
        commit: u64,
        query: Option<String>,
    },
    Suggest {
        db_dir: PathBuf,
    },
    Algo {
        db_dir: PathBuf,
        subcmd: AlgoSubcmd,
        top: usize,
    },
    Query {
        db_dir: PathBuf,
        cypher: String,
    },
    Snapshot {
        db_dir: PathBuf,
        keep_wal: bool,
    },
    SchemaApply {
        db_dir: PathBuf,
        schema_file: PathBuf,
    },
    Help,
}
Expand description

Parsed mushroomdb invocation.

Variants§

§

Serve

Fields

§db_dir: PathBuf
§demo_if_empty: bool

If the db dir is missing or empty, run run_demo before serving. Docker’s default CMD uses this so a fresh volume is ready on first boot.

§token: Option<String>

Bearer token for non-loopback binds. Loopback may omit it.

§snapshot_every: Option<Duration>

Periodic snapshot cadence. None = off (default).

§

Mcp

Fields

§db_dir: PathBuf
§

Stats

Fields

§db_dir: PathBuf
§

Demo

Fields

§db_dir: PathBuf
§

AsOf

Read-only view of the database at a past commit.

Fields

§db_dir: PathBuf
§commit: u64

0-based WAL commit index to replay up to (inclusive).

§query: Option<String>

Optional Cypher read query to execute against the as-of view.

§

Suggest

Profile the database and suggest linking rules with estimated edge counts.

Fields

§db_dir: PathBuf
§

Algo

Run a graph algorithm (pagerank / wcc / degree).

Fields

§db_dir: PathBuf
§subcmd: AlgoSubcmd
§top: usize

Print only the top N results (0 = all).

§

Query

Run a Cypher query (read or write).

Fields

§db_dir: PathBuf
§cypher: String

Positional after dir (remaining args joined), or --query.

§

Snapshot

Write snapshot.bin (default truncates WAL unless --keep-wal).

Fields

§db_dir: PathBuf
§keep_wal: bool
§

SchemaApply

Apply a JSON schema file idempotently (schema apply <db-dir> <schema.json>).

Fields

§db_dir: PathBuf
§schema_file: PathBuf
§

Help

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

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
Source§

impl Eq for Command

Source§

impl PartialEq for Command

Source§

fn eq(&self, other: &Command) -> 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 Command

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

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.