[][src]Struct k::joint::Range

pub struct Range<T: RealField> {
    pub min: T,
    pub max: T,
}

min/max range to check the joint position

Fields

min: Tmax: T

Methods

impl<T> Range<T> where
    T: RealField
[src]

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

Create new Range instance

Examples

let range = k::joint::Range::new(-1.0, 1.0);

pub fn is_valid(&self, val: T) -> bool[src]

Check if the value is in the range

true means it is OK. If the val is the same as the limit value (min or max), it returns true (valid).

Examples

let range = k::joint::Range::new(-1.0, 1.0);
assert!(range.is_valid(0.0));
assert!(range.is_valid(1.0));
assert!(!range.is_valid(1.5));

Trait Implementations

impl<T: Clone + RealField> Clone for Range<T>[src]

impl<T: Copy + RealField> Copy for Range<T>[src]

impl<T: Debug + RealField> Debug for Range<T>[src]

impl<T> From<RangeInclusive<T>> for Range<T> where
    T: RealField
[src]

fn from(range: RangeInclusive<T>) -> Self[src]

Examples

let range : k::joint::Range<f64> = (-1.0..=1.0).into();
assert!(range.is_valid(0.0));
assert!(range.is_valid(1.0));
assert!(!range.is_valid(1.5));

Auto Trait Implementations

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

impl<T> Send for Range<T>

impl<T> Sync for Range<T>

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

impl<T> UnwindSafe for Range<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> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.