Local

Struct Local 

Source
pub struct Local<N>(pub PointN<N>);
Expand description

Map-local coordinates.

Most commonly, you will index a lattice map with a PointN<N>, which is assumed to be in global coordinates. Local<N> only applies to lattice maps where a point must first be translated from global coordinates into map-local coordinates before indexing with Get<Local<N>>.

Tuple Fields§

§0: PointN<N>

Implementations§

Source§

impl<N> Local<N>

Source

pub fn localize_points_slice(points: &[PointN<N>]) -> Vec<Local<N>>
where PointN<N>: Clone,

Wraps all of the points using the Local constructor.

Source

pub fn localize_points_array<const LEN: usize>( points: &[PointN<N>; LEN], ) -> [Local<N>; LEN]
where PointN<N>: ConstZero,

Wraps all of the points using the Local constructor.

Trait Implementations§

Source§

impl<N> Clone for Local<N>
where PointN<N>: Clone,

Source§

fn clone(&self) -> Local<N>

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<N> Debug for Local<N>
where N: Debug,

Source§

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

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

impl<N> Deref for Local<N>

Source§

type Target = PointN<N>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Local<N> as Deref>::Target

Dereferences the value.
Source§

impl<N, Chan> Get<Local<N>> for Array<N, Chan>
where Array<N, Chan>: IndexedArray<N> + Get<Stride>, PointN<N>: Copy,

Source§

type Item = <Array<N, Chan> as Get<Stride>>::Item

Source§

fn get(&self, p: Local<N>) -> <Array<N, Chan> as Get<Local<N>>>::Item

Get an owned value at location.
Source§

impl<'a, N, Chan> GetMut<'a, Local<N>> for Array<N, Chan>
where Array<N, Chan>: IndexedArray<N> + GetMut<'a, Stride>, PointN<N>: Copy,

Source§

type Item = <Array<N, Chan> as GetMut<'a, Stride>>::Item

Source§

fn get_mut( &'a mut self, p: Local<N>, ) -> <Array<N, Chan> as GetMut<'a, Local<N>>>::Item

Get a mutable reference to the value at location.
Source§

impl<'a, N, Chan> GetRef<'a, Local<N>> for Array<N, Chan>
where Array<N, Chan>: IndexedArray<N> + GetRef<'a, Stride>, PointN<N>: Copy,

Source§

type Item = <Array<N, Chan> as GetRef<'a, Stride>>::Item

Source§

fn get_ref( &'a self, p: Local<N>, ) -> <Array<N, Chan> as GetRef<'a, Local<N>>>::Item

Get an immutable reference to the value at location.
Source§

impl<N> PartialEq for Local<N>
where N: PartialEq,

Source§

fn eq(&self, other: &Local<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<N> Copy for Local<N>
where PointN<N>: Copy,

Source§

impl<N> Eq for Local<N>
where N: Eq,

Source§

impl<N> StructuralPartialEq for Local<N>

Auto Trait Implementations§

§

impl<N> Freeze for Local<N>
where N: Freeze,

§

impl<N> RefUnwindSafe for Local<N>
where N: RefUnwindSafe,

§

impl<N> Send for Local<N>
where N: Send,

§

impl<N> Sync for Local<N>
where N: Sync,

§

impl<N> Unpin for Local<N>
where N: Unpin,

§

impl<N> UnwindSafe for Local<N>
where N: UnwindSafe,

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)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: Copy + PartialEq + Debug + Any,

Source§

fn inlined_clone(&self) -> T

Performance hack: Clone doesn’t get inlined for Copy types in debug mode, so make it inline anyway.
Source§

fn is<T>() -> bool
where T: Scalar,

Tests if Self the same as the type T Read more
Source§

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

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.