Enum SubCommands

Source
pub enum SubCommands {
    Mine {
Show 18 fields no_gui: bool, fps: f32, progress_message_scrollback_buffer_size: usize, no_db_download: bool, io_bound_processors: u32, cpu_o_bound_processors: u32, cpu_bound_processors: u32, repository: Option<PathBuf>, time_limit: Option<Duration>, fetch_every: Duration, fetch_at_most: Option<usize>, process_every: Duration, process_at_most: Option<usize>, report_every: Duration, report_at_most: Option<usize>, download_crates_io_database_every_24_hours_starting_at: Option<Time>, glob: Option<String>, db_path: PathBuf,
}, Export { input_db_path: PathBuf, export_db_path: PathBuf, }, }

Variants§

§

Mine

Mine crates.io in an incorruptible and resumable fashion

Fields

§no_gui: bool

If set, no gui will be presented. Best with RUST_LOG=info to see basic information.

§fps: f32

The amount of frames to show per second

§progress_message_scrollback_buffer_size: usize

The amount of progress messages to keep in a ring buffer.

§no_db_download: bool

If set, the crates-index database for additional metadata will not be downloaded.

It costs a lot of initial processing time and IO when writing changes back to the database, which isn’t helpful while on a slow disk - right now it does so unconditionally and doesn’t track that the work was already done.

§io_bound_processors: u32

The amount of IO-bound processors to run concurrently.

A way to choose a value is to see which part of the I/O is actually the bottle neck. Depending on that number, one should experiment with an amount of processors that saturate either input or output. Most commonly, these are bound to the input, as it is the network.

§cpu_o_bound_processors: u32

The amount of CPU- and Output-bound processors to run concurrently.

These will perform a computation followed by flushing its result to disk in the form of multiple small files. It’s recommended to adjust that number to whatever can saturate the speed of writing to disk, as these processors will yield when writing, allowing other processors to compute. Computes are relatively inexpensive compared to the writes.

§cpu_bound_processors: u32

The amount of CPU-bound processors to run concurrently.

One can assume that one of these can occupy one core of a CPU. However, they will not use a lot of IO, nor will they use much memory.

§repository: Option<PathBuf>

Path to the possibly existing crates.io repository clone. If unset, it will be cloned to a temporary spot.

§time_limit: Option<Duration>

The amount of time we can take for the computation. Specified in humantime, like 10s, 5min, or 2h, or ‘3h 2min 2s’

§fetch_every: Duration

The time between each fetch operation, specified in humantime, like 10s, 5min, or 2h, or ‘3h 2min 2s’

§fetch_at_most: Option<usize>

If set, the amount of times the fetch stage will run. If set to 0, it will never run.

§process_every: Duration

The time between each processing run, specified in humantime, like 10s, 5min, or 2h, or ‘3h 2min 2s’

§process_at_most: Option<usize>

If set, the amount of times the process stage will run. If set to 0, they will never run.

§report_every: Duration

The time between each reporting and processing run, specified in humantime, like 10s, 5min, or 2h, or ‘3h 2min 2s’

§report_at_most: Option<usize>

If set, the amount of times the reporting stage will run. If set to 0, they will never run.

§download_crates_io_database_every_24_hours_starting_at: Option<Time>

If set, declare at which local time to download the crates.io database and digest it.

This job runs every 24h, as the database is updated that often. If unset, the job starts right away. Format is HH:MM, e.g. ‘14:30’ for 2:30 pm or 03:15 for quarter past 3 in the morning.

§glob: Option<String>

If set, the reporting stage will only iterate over crates that match the given standard unix glob.

moz* would match only crates starting with ‘moz’ for example.

§db_path: PathBuf

Path to the possibly existing database. It’s used to persist all mining results.

§

Export

Export all Criner data into a format friendly for exploration via SQL, best viewed with https://sqlitebrowser.org

Criner stores binary blobs internally and migrates them on the fly, which is optimized for raw performance. It’s also impractical for exploring the data by hand, so the exported data will explode all types into tables with each column being a field. Foreign key relations are set accordingly to allow joins. Use this to get an overview of what’s available, and possibly contribute a report generator which implements a query using raw data and writes it into reports.

Fields

§input_db_path: PathBuf

The path to the source database in sqlite format

§export_db_path: PathBuf

Path to which to write the exported data. If it exists the operation will fail.

Trait Implementations§

Source§

impl CommandFactory for SubCommands

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for SubCommands

Source§

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

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

impl Default for SubCommands

Source§

fn default() -> Self

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

impl FromArgMatches for SubCommands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for SubCommands

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
Source§

impl Subcommand for SubCommands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

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> CompatExt for T

Source§

fn compat(self) -> Compat<T>

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
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<T> ErasedDestructor for T
where T: 'static,