[][src]Struct gdnative_core::init::property::hint::RangeHint

pub struct RangeHint<T> {
    pub min: T,
    pub max: T,
    pub step: Option<T>,
    pub or_greater: bool,
    pub or_lesser: bool,
}

Hints that an integer or float property should be within an inclusive range.

Examples

Basic usage:

use gdnative_core::init::property::hint::RangeHint;

let hint: RangeHint<f64> = RangeHint::new(0.0, 20.0).or_greater();

Fields

min: T

Minimal value, inclusive

max: T

Maximal value, inclusive

step: Option<T>

Optional step value for the slider

or_greater: bool

Allow manual input above the max value

or_lesser: bool

Allow manual input below the min value

Methods

impl<T> RangeHint<T> where
    T: Display
[src]

pub fn new(min: T, max: T) -> Self[src]

Creates a new RangeHint.

pub fn with_step(self, step: T) -> Self[src]

Builder-style method that returns self with the given step.

pub fn or_greater(self) -> Self[src]

Builder-style method that returns self with the or_greater hint.

pub fn or_lesser(self) -> Self[src]

Builder-style method that returns self with the or_lesser hint.

pub fn to_godot_hint_string(&self) -> GodotString[src]

Formats the hint as a Godot hint string.

Trait Implementations

impl<T: Clone> Clone for RangeHint<T>[src]

impl<T: Copy> Copy for RangeHint<T>[src]

impl<T: Debug> Debug for RangeHint<T>[src]

impl<T: Default> Default for RangeHint<T>[src]

impl<T: Eq> Eq for RangeHint<T>[src]

impl<T> From<RangeHint<T>> for IntHint<T> where
    T: Display
[src]

impl<T> From<RangeHint<T>> for FloatHint<T> where
    T: Display
[src]

impl<T> From<RangeInclusive<T>> for RangeHint<T> where
    T: Display
[src]

impl<T: PartialEq> PartialEq<RangeHint<T>> for RangeHint<T>[src]

impl<T> StructuralEq for RangeHint<T>[src]

impl<T> StructuralPartialEq for RangeHint<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for RangeHint<T> where
    T: RefUnwindSafe

impl<T> Send for RangeHint<T> where
    T: Send

impl<T> Sync for RangeHint<T> where
    T: Sync

impl<T> Unpin for RangeHint<T> where
    T: Unpin

impl<T> UnwindSafe for RangeHint<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.