Struct cvar::ClampedProp

source ·
pub struct ClampedProp<'a, 'x, T: 'static> { /* private fields */ }
Expand description

Property node with its value clamped.

Implementations§

source§

impl<'a, 'x, T> ClampedProp<'a, 'x, T>

source

pub fn new( name: &'a str, variable: &'x mut T, default: &'a T, min: Option<&'a T>, max: Option<&'a T> ) -> ClampedProp<'a, 'x, T>

Trait Implementations§

source§

impl<'a, 'x, T> INode for ClampedProp<'a, 'x, T>where T: Clone + Default + PartialEq + PartialOrd + Display + FromStr, T::Err: StdError + Send + Sync + 'static,

source§

fn name(&self) -> &str

Returns the node name.
source§

fn as_node(&mut self) -> Node<'_>

Downcasts to a more specific node interface.
source§

fn as_inode(&mut self) -> &mut dyn INode

Upcasts back to an INode trait object.
source§

impl<'a, 'x, T> IProperty for ClampedProp<'a, 'x, T>where T: Clone + Default + PartialEq + PartialOrd + Display + FromStr, T::Err: StdError + Send + Sync + 'static,

source§

fn get_value(&self) -> &dyn IValue

Gets the value.
source§

fn set_value(&mut self, val: &dyn IValue, writer: &mut dyn IWrite) -> bool

Sets the value.
source§

fn set(&mut self, val: &str, writer: &mut dyn IWrite) -> bool

Sets the value parsed from string.
source§

fn reset(&mut self)

Resets the value to its default. Read more
source§

fn default_value(&self) -> &dyn IValue

Gets the default value.
source§

fn state(&self) -> PropState

Returns the state of the property.
source§

fn flags(&self) -> u32

Returns the flags associated with the property. Read more
source§

fn values(&self) -> Option<&[&str]>

Returns a list of valid value strings for this property. Read more

Auto Trait Implementations§

§

impl<'a, 'x, T> RefUnwindSafe for ClampedProp<'a, 'x, T>where T: RefUnwindSafe,

§

impl<'a, 'x, T> Send for ClampedProp<'a, 'x, T>where T: Send + Sync,

§

impl<'a, 'x, T> Sync for ClampedProp<'a, 'x, T>where T: Sync,

§

impl<'a, 'x, T> Unpin for ClampedProp<'a, 'x, T>

§

impl<'a, 'x, T> !UnwindSafe for ClampedProp<'a, 'x, T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.