Skip to main content

Cli

Struct Cli 

Source
pub struct Cli {
Show 55 fields pub db: String, pub query: Option<String>, pub query_arg: Option<String>, pub trace: bool, pub indexed_lookups: bool, pub auto_create_missing_references: bool, pub structure: Option<u32>, pub before: bool, pub changes: bool, pub after: bool, pub lino_input: Option<String>, pub lino_output: Option<String>, pub binary_input: Option<String>, pub binary_output: Option<String>, pub always: bool, pub once: bool, pub never: bool, pub triggers: bool, pub triggers_file: Option<String>, pub embed_triggers: bool, pub transactions: bool, pub transactions_file: Option<String>, pub commit_mode: Option<String>, pub retention: Option<String>, pub vc: bool, pub vc_file: Option<String>, pub branch: Option<String>, pub branch_from: Option<i64>, pub checkout: Option<String>, pub tag: Option<String>, pub list_branches: bool, pub list_tags: bool, pub show_log: bool, pub serve: Option<String>, pub serve_also: Vec<String>, pub forward: Option<String>, pub graphql: bool, pub jwt_secret: Option<String>, pub graphql_admin_secret: Option<String>, pub deep_packages: Vec<String>, pub connect: Option<String>, pub protocol: Option<String>, pub external_references: bool, pub arity: ArityRange, pub packed_widths: bool, pub triplets: bool, pub permissions: Option<String>, pub subject: Option<String>, pub tokens: Option<String>, pub grant_token: Option<String>, pub revoke_token: Option<String>, pub token: Option<String>, pub lock: Option<String>, pub lock_timeout: Option<String>, pub lock_status: bool,
}

Fields§

§db: String§query: Option<String>§query_arg: Option<String>§trace: bool§indexed_lookups: bool§auto_create_missing_references: bool§structure: Option<u32>§before: bool§changes: bool§after: bool§lino_input: Option<String>§lino_output: Option<String>§binary_input: Option<String>§binary_output: Option<String>§always: bool§once: bool§never: bool§triggers: bool§triggers_file: Option<String>§embed_triggers: bool§transactions: bool§transactions_file: Option<String>§commit_mode: Option<String>§retention: Option<String>§vc: bool§vc_file: Option<String>§branch: Option<String>§branch_from: Option<i64>§checkout: Option<String>§tag: Option<String>§list_branches: bool§list_tags: bool§show_log: bool§serve: Option<String>

The first --serve endpoint, such as 127.0.0.1:7878 or unix:/tmp/links.sock (issue #140).

§serve_also: Vec<String>

Every later --serve endpoint: one server listens on all of them.

§forward: Option<String>

--forward: relay each --serve connection to this endpoint, byte for byte, instead of serving a database (issue #140).

§graphql: bool

--graphql: --serve speaks Hasura’s GraphQL for Deep (issue #153).

§jwt_secret: Option<String>

--jwt-secret: signs the tokens of --graphql; random when absent.

§graphql_admin_secret: Option<String>

--graphql-admin-secret: what x-hasura-admin-secret must be.

§deep_packages: Vec<String>

--deep-package: Deep links, as JSON rows, to load before serving.

§connect: Option<String>§protocol: Option<String>§external_references: bool§arity: ArityRange§packed_widths: bool§triplets: bool

--triplets: --serve reads every request as triplets (issue #152).

§permissions: Option<String>

--permissions: self or a links file of permission rules (issue #149).

§subject: Option<String>

--subject: the link index or name queries run as.

§tokens: Option<String>

--tokens: self or a links file of the token table.

§grant_token: Option<String>§revoke_token: Option<String>§token: Option<String>

--token: authenticates a --connect client.

§lock: Option<String>

--lock (--no-lock is none), --lock-timeout and --lock-status; see crate::store_lock.

§lock_timeout: Option<String>§lock_status: bool

Implementations§

Source§

impl Cli

Source

pub fn transactions_requested(&self) -> bool

True when any flag in the transactions decorator family was passed.

Source

pub fn trigger_command_count(&self) -> usize

True when a trigger command — --always, --once or --never — was passed. Exactly one of them may be used at a time.

Source

pub fn persistent_transformations_requested(&self) -> bool

True when any flag in the persistent transformation family was passed.

Mirrors persistentTransformationsEnabled in the C# tool, minus the “the triggers file already exists” clause, which needs the resolved path and therefore lives next to it in main.

Source

pub fn serve_endpoints(&self) -> Vec<&str>

Every --serve endpoint, in the order given.

Source

pub fn vc_requested(&self) -> bool

True when any flag in the version-control decorator family was passed.

Source

pub fn parse() -> Result<CliCommand>

Source

pub fn parse_from<I, T>(args: I) -> Result<CliCommand>
where I: IntoIterator<Item = T>, T: Into<OsString>,

Source

pub fn print_help()

Source

pub fn help_text() -> &'static str

Source

pub fn version_text() -> String

Trait Implementations§

Source§

impl Clone for Cli

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 Cli

Source§

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

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

impl Default for Cli

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Cli

Source§

impl PartialEq for Cli

Source§

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

Auto Trait Implementations§

§

impl Freeze for Cli

§

impl RefUnwindSafe for Cli

§

impl Send for Cli

§

impl Sync for Cli

§

impl Unpin for Cli

§

impl UnsafeUnpin for Cli

§

impl UnwindSafe for Cli

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> 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.