Skip to main content

FormInputField

Enum FormInputField 

Source
pub enum FormInputField {
    Label {
        prompt: String,
    },
    Separator,
    TextLine {
        prompt: String,
        default: Option<String>,
        value: Option<String>,
    },
    MultilineText {
        prompt: String,
        default: Option<String>,
        value: Option<String>,
    },
    Integer {
        prompt: String,
        default: Option<i64>,
        value: i64,
    },
    Address {
        prompt: String,
        view: Option<Ref<BinaryView>>,
        current_address: u64,
        default: Option<u64>,
        value: u64,
    },
    Choice {
        prompt: String,
        choices: Vec<String>,
        default: Option<usize>,
        value: usize,
    },
    OpenFileName {
        prompt: String,
        extension: Option<String>,
        default: Option<String>,
        value: Option<String>,
    },
    SaveFileName {
        prompt: String,
        extension: Option<String>,
        default: Option<String>,
        value: Option<String>,
    },
    DirectoryName {
        prompt: String,
        default: Option<String>,
        value: Option<String>,
    },
    Checkbox {
        prompt: String,
        default: Option<bool>,
        value: bool,
    },
}
Expand description

A field within a form.

Variants§

§

Label

Fields

§prompt: String
§

Separator

§

TextLine

Fields

§prompt: String
§default: Option<String>
§

MultilineText

Fields

§prompt: String
§default: Option<String>
§

Integer

Fields

§prompt: String
§default: Option<i64>
§value: i64
§

Address

Fields

§prompt: String
§current_address: u64
§default: Option<u64>
§value: u64
§

Choice

Fields

§prompt: String
§choices: Vec<String>
§default: Option<usize>
§value: usize
§

OpenFileName

Fields

§prompt: String
§extension: Option<String>

File extension to filter on.

§default: Option<String>
§

SaveFileName

Fields

§prompt: String
§extension: Option<String>

File extension to filter on.

§default: Option<String>
§

DirectoryName

Fields

§prompt: String
§default: Option<String>
§

Checkbox

Fields

§prompt: String
§default: Option<bool>
§value: bool

Implementations§

Source§

impl FormInputField

Source

pub fn from_raw(value: &BNFormInputField) -> Self

Source

pub fn from_owned_raw(value: BNFormInputField) -> Self

Source

pub fn into_raw(&self) -> BNFormInputField

Source

pub fn free_raw(value: BNFormInputField)

Source

pub fn as_type(&self) -> BNFormInputFieldType

Source

pub fn try_prompt(&self) -> Option<String>

Mapping to the BNFormInputField::prompt field.

Source

pub fn try_view(&self) -> Option<Ref<BinaryView>>

Mapping to the BNFormInputField::view field.

Source

pub fn try_current_address(&self) -> Option<u64>

Mapping to the BNFormInputField::currentAddress field.

Source

pub fn try_choices(&self) -> Option<Vec<String>>

Mapping to the BNFormInputField::choices field.

Source

pub fn try_extension(&self) -> Option<String>

Mapping to the BNFormInputField::ext field.

Source

pub fn try_has_default(&self) -> Option<bool>

Mapping to the BNFormInputField::hasDefault field.

Source

pub fn try_default_name(&self) -> Option<String>

Mapping to the BNFormInputField::defaultName field.

Source

pub fn try_default_int(&self) -> Option<i64>

Mapping to the BNFormInputField::intDefault field.

Source

pub fn try_default_address(&self) -> Option<u64>

Mapping to the BNFormInputField::addressDefault field.

Source

pub fn try_default_string(&self) -> Option<String>

Mapping to the BNFormInputField::stringDefault field.

Source

pub fn try_default_index(&self) -> Option<usize>

Mapping to the BNFormInputField::indexDefault field.

Source

pub fn try_value_int(&self) -> Option<i64>

Mapping to the BNFormInputField::intResult field.

Source

pub fn try_value_address(&self) -> Option<u64>

Mapping to the BNFormInputField::addressResult field.

Source

pub fn try_value_string(&self) -> Option<String>

Mapping to the BNFormInputField::stringResult field.

Source

pub fn try_value_index(&self) -> Option<usize>

Mapping to the BNFormInputField::indexResult field.

Trait Implementations§

Source§

impl Clone for FormInputField

Source§

fn clone(&self) -> FormInputField

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 FormInputField

Source§

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

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

impl Eq for FormInputField

Source§

impl PartialEq for FormInputField

Source§

fn eq(&self, other: &FormInputField) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for FormInputField

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> 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 #126799)
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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more