pub struct PromptField {
pub key: String,
pub prompt: String,
pub type: String,
pub default: Option<Value>,
pub default_from: Option<String>,
pub read_var: Option<String>,
pub optional: bool,
pub requires: Option<String>,
}Expand description
A single field inside a PromptSection.
Fields§
§key: StringVariable name the value is stored under.
prompt: StringQuestion presented to the user.
type: StringField type: string (default), bool, int. Future: password,
path, enum.
default: Option<Value>Literal default value.
default_from: Option<String>Lookup expression for the default. Examples:
git:user.name— rungit config --get user.nameenv:USER— read env varfield:email— value of an earlier fieldread_var:terminal— read existing Hyprland$terminalfrom dest
read_var: Option<String>Read the current value of a Hyprland-style variable from the
destination file when computing the default. Shorthand alternative
to default_from = "read_var:...".
optional: boolIf true, blank answers are allowed.
requires: Option<String>Only ask this field if the named earlier field has a non-empty value.
Trait Implementations§
Source§impl Clone for PromptField
impl Clone for PromptField
Source§fn clone(&self) -> PromptField
fn clone(&self) -> PromptField
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptField
impl Debug for PromptField
Source§impl<'de> Deserialize<'de> for PromptField
impl<'de> Deserialize<'de> for PromptField
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PromptField
impl RefUnwindSafe for PromptField
impl Send for PromptField
impl Sync for PromptField
impl Unpin for PromptField
impl UnsafeUnpin for PromptField
impl UnwindSafe for PromptField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more