UIFieldValue

Enum UIFieldValue 

Source
pub enum UIFieldValue<V> {
Show 20 variants Header, Label(String), InputFieldFloat(f32), InputFieldInteger(i32), InputFieldString(String), InputFieldFloat2(f32, f32), InputFieldInteger2(i32, i32), InputFieldUnsignedInteger(u32), ValueSliderFloat(f32), ValueSliderInteger(i32), Collapsable(Vec<V>), Array(Vec<Vec<V>>), Choice(String), Checkbox(bool), Color(u8, u8, u8, u8), ImageData(String), ExistingImage(String), Font(String), Button, ImagePreview(String),
}
Expand description

UI Field value, current state of the settings

Variants§

§

Header

Displays a header for separation reasons

§

Label(String)

Displays text

§

InputFieldFloat(f32)

Text field that accepts float values

§

InputFieldInteger(i32)

Text field that accepts integer values

§

InputFieldString(String)

Text field that accepts strings

§

InputFieldFloat2(f32, f32)

Text field that accepts 2 float values

§

InputFieldInteger2(i32, i32)

Text field that accepts 2 integer values

§

InputFieldUnsignedInteger(u32)

Text field that accepts only positive integer values

§

ValueSliderFloat(f32)

Float slider of specified bounds

§

ValueSliderInteger(i32)

Integer slider of specified bounds

§

Collapsable(Vec<V>)

Collapsable submenu

§

Array(Vec<Vec<V>>)

Array of menus

§

Choice(String)

Choice dropdown

§

Checkbox(bool)

Checkbox

§

Color(u8, u8, u8, u8)

Color picker

§

ImageData(String)

Image data encoded in base64

§

ExistingImage(String)

Image from image collection

§

Font(String)

Font name

§

Button

Button

§

ImagePreview(String)

Previews an image on UI, png image data encoded in base64

Implementations§

Source§

impl<V> UIFieldValue<V>

Source

pub fn try_into_bool(&self) -> Result<bool, String>

Attempts to parse the value into a boolean

Source

pub fn try_into_f32(&self) -> Result<f32, String>

Attempts to parse the value into a floating number

Source

pub fn try_into_i32(&self) -> Result<i32, String>

Attempts to parse the value into an integer

Source

pub fn try_into_u32(&self) -> Result<u32, String>

Attempts to parse the value into an unsigned integer

Source

pub fn try_into_f32_f32(&self) -> Result<(f32, f32), String>

Attempts to parse the value into a pair of floating numbers

Source

pub fn try_into_i32_i32(&self) -> Result<(i32, i32), String>

Attempts to parse the value into a pair of integers

Source

pub fn try_into_color(&self) -> Result<Color, String>

Attempts to parse the value into a color

Source

pub fn try_into_string(&self) -> Result<String, String>

Attempts to parse the value into a string

Trait Implementations§

Source§

impl<V: Clone> Clone for UIFieldValue<V>

Source§

fn clone(&self) -> UIFieldValue<V>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V: Debug> Debug for UIFieldValue<V>

Source§

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

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

impl<'de, V> Deserialize<'de> for UIFieldValue<V>
where V: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<UIFieldValue<UIPathValue>> for UIFieldValue<UIValue>

Source§

fn from(val: UIFieldValue<UIPathValue>) -> Self

Converts to this type from the input type.
Source§

impl From<UIFieldValue<UIValue>> for UIFieldValue<UIPathValue>

Source§

fn from(val: UIFieldValue<UIValue>) -> Self

Converts to this type from the input type.
Source§

impl<V> Into<UIFieldValue<V>> for &Color

Source§

fn into(self) -> UIFieldValue<V>

Converts this type into the (usually inferred) input type.
Source§

impl<V> Into<UIFieldValue<V>> for Color

From conversions

Source§

fn into(self) -> UIFieldValue<V>

Converts this type into the (usually inferred) input type.
Source§

impl<V> Serialize for UIFieldValue<V>
where V: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<V> TryInto<(f32, f32)> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<(f32, f32), Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<(f32, f32)> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<(f32, f32), Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<(i32, i32)> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<(i32, i32), Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<(i32, i32)> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<(i32, i32), Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<(u8, u8, u8, u8)> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Color, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<(u8, u8, u8, u8)> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Color, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<PathBuf> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<PathBuf, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<PathBuf> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<PathBuf, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<String> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<String, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<String> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<String, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<bool> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<bool, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<bool> for UIFieldValue<V>

To conversions

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<bool, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<f32> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<f32, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<f32> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<f32, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<i32> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i32, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<i32> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i32, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<u32> for &UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u32, Self::Error>

Performs the conversion.
Source§

impl<V> TryInto<u32> for UIFieldValue<V>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u32, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<V> Freeze for UIFieldValue<V>

§

impl<V> RefUnwindSafe for UIFieldValue<V>
where V: RefUnwindSafe,

§

impl<V> Send for UIFieldValue<V>
where V: Send,

§

impl<V> Sync for UIFieldValue<V>
where V: Sync,

§

impl<V> Unpin for UIFieldValue<V>
where V: Unpin,

§

impl<V> UnwindSafe for UIFieldValue<V>
where V: UnwindSafe,

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
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> 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<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
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, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,