[][src]Struct procshot_server::Config

pub struct Config {
    pub hostname: String,
    pub delay: u64,
    pub server: bool,
    pub client_time_from: String,
    pub client_sort_by: String,
}

Config struct holds the user input when running the server. It is a bad design to hold the client's option as well in the same struct, but as of now, it is here.

Fields

hostname: String

hostname of the server. This is derived by this crate from the hostname crate.

delay: u64

Delay decides how many seconds to sleep after each iteration of scanning /proc

server: bool

If true, runs as server. Defaults to false. Pass the subcommand server to set it to true.

client_time_from: String

The time from which the client can fetch data to process.

client_sort_by: String

Sort the processed data by whatever the user wants.

Methods

impl Config[src]

Returns a new config object. This also gives the following command line argument options.

Examples

Here are the cli options used to populate the struct.

sudo target/debug/procshot --help

procshot 1.0
nohupped@gmail.com
Snapshots proc periodically. All the options except delay works when 'server' option is not used.

USAGE:
    procshot [FLAGS] [OPTIONS] [SUBCOMMAND]
FLAGS:
    -h, --help       Prints help information
    -o               Sort result by Memory or CPU. Accepted values are...
    -t               Read stats from a specific time. Accepted format: 2015-09-05 23:56:04
    -V, --version    Prints version information

OPTIONS:
    -d, --delay <delay>      Sets delay in seconds before it scans /proc every time. [default: 60]

SUBCOMMANDS:
    help      Prints this message or the help of the given subcommand(s)
    server    Decides whether to run as server or client

pub fn new() -> Self[src]

Trait Implementations

impl Debug for Config[src]

Auto Trait Implementations

impl Unpin for Config

impl Sync for Config

impl Send for Config

impl RefUnwindSafe for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]