ShellConfig

Trait ShellConfig 

Source
pub trait ShellConfig {
    const MAX_INPUT: usize;
    const MAX_PATH_DEPTH: usize;
    const MAX_ARGS: usize;
    const MAX_PROMPT: usize;
    const MAX_RESPONSE: usize;
    const HISTORY_SIZE: usize;
    const MSG_WELCOME: &'static str;
    const MSG_LOGIN_PROMPT: &'static str;
    const MSG_LOGIN_SUCCESS: &'static str;
    const MSG_LOGIN_FAILED: &'static str;
    const MSG_LOGOUT: &'static str;
    const MSG_INVALID_LOGIN_FORMAT: &'static str;
}
Expand description

Shell configuration trait defining buffer sizes and capacity limits.

All values are const (zero runtime cost). Due to Rust’s const generics limitations (const trait bounds not yet stable), internal buffers use hardcoded sizes from DefaultConfig rather than C::MAX_INPUT, etc. The trait establishes the API contract for when const generics stabilize.

Currently customizable: MSG_* strings only. Not yet customizable: Buffer size constants (hardcoded to DefaultConfig values).

Required Associated Constants§

Source

const MAX_INPUT: usize

Maximum input buffer size (default: 128)

Source

const MAX_PATH_DEPTH: usize

Maximum path depth (default: 8)

Source

const MAX_ARGS: usize

Maximum number of command arguments (default: 16)

Source

const MAX_PROMPT: usize

Maximum prompt length (default: 64)

Source

const MAX_RESPONSE: usize

Maximum response message length (default: 256)

Source

const HISTORY_SIZE: usize

Command history size (default: 10)

Source

const MSG_WELCOME: &'static str

Welcome message shown on activation

Source

const MSG_LOGIN_PROMPT: &'static str

Login prompt

Source

const MSG_LOGIN_SUCCESS: &'static str

Login success message

Source

const MSG_LOGIN_FAILED: &'static str

Login failed message

Source

const MSG_LOGOUT: &'static str

Logout message

Source

const MSG_INVALID_LOGIN_FORMAT: &'static str

Invalid login format message

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ShellConfig for DefaultConfig

Source§

const MAX_INPUT: usize = 128usize

Source§

const MAX_PATH_DEPTH: usize = 8usize

Source§

const MAX_ARGS: usize = 16usize

Source§

const MAX_PROMPT: usize = 64usize

Source§

const MAX_RESPONSE: usize = 256usize

Source§

const HISTORY_SIZE: usize = 10usize

Source§

const MSG_WELCOME: &'static str = "Welcome to nut-shell! Type '?' for help."

Source§

const MSG_LOGIN_PROMPT: &'static str = "Login> "

Source§

const MSG_INVALID_LOGIN_FORMAT: &'static str = "Invalid login format. Use: <name>:<password>"

Source§

const MSG_LOGIN_FAILED: &'static str = "Login failed. Try again."

Source§

const MSG_LOGIN_SUCCESS: &'static str = "Logged in. Type '?' for help."

Source§

const MSG_LOGOUT: &'static str = "Logged out."

Source§

impl ShellConfig for MinimalConfig

Source§

const MAX_INPUT: usize = 64usize

Source§

const MAX_PATH_DEPTH: usize = 4usize

Source§

const MAX_ARGS: usize = 8usize

Source§

const MAX_PROMPT: usize = 32usize

Source§

const MAX_RESPONSE: usize = 128usize

Source§

const HISTORY_SIZE: usize = 4usize

Source§

const MSG_WELCOME: &'static str = "Welcome"

Source§

const MSG_LOGIN_PROMPT: &'static str = "Login> "

Source§

const MSG_INVALID_LOGIN_FORMAT: &'static str = "Invalid format. Use name:pass"

Source§

const MSG_LOGIN_FAILED: &'static str = "Login failed"

Source§

const MSG_LOGIN_SUCCESS: &'static str = "Logged in"

Source§

const MSG_LOGOUT: &'static str = "Logged out"