Skip to main content

VectorWithDefault

Struct VectorWithDefault 

Source
pub struct VectorWithDefault<T, const N: usize, Policy>
where Policy: Constant<T>,
{ pub value: Vector<T, N>, /* private fields */ }
Expand description

Used to define default value, and different deserialization based on a constant for non_exhaustive/missing field.

Fields§

§value: Vector<T, N>

Implementations§

Source§

impl<T, const N: usize, Policy> VectorWithDefault<T, N, Policy>
where Policy: Constant<T>,

Source

pub const fn new(value: Vector<T, N>) -> Self

Source

pub fn into_value(self) -> Vector<T, N>

Trait Implementations§

Source§

impl<T, const N: usize, Policy> AsMut<Vector<T, N>> for VectorWithDefault<T, N, Policy>
where Policy: Constant<T>,

Source§

fn as_mut(&mut self) -> &mut Vector<T, N>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<T, const N: usize, Policy> AsRef<Vector<T, N>> for VectorWithDefault<T, N, Policy>
where Policy: Constant<T>,

Source§

fn as_ref(&self) -> &Vector<T, N>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: Clone, const N: usize, Policy> Clone for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Copy, const N: usize, Policy> Copy for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + Copy,

Source§

impl<T: Debug, const N: usize, Policy> Debug for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + Debug,

Source§

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

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

impl<T, const N: usize, Policy> Default for VectorWithDefault<T, N, Policy>
where Policy: Constant<T>,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, T, Policy, const N: usize> Deserialize<'de> for VectorWithDefault<T, N, Policy>
where Vector<T, N>: Deserialize<'de>, Policy: Constant<T>,

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<T: Eq, const N: usize, Policy> Eq for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + Eq,

Source§

impl<T, const N: usize, Policy> From<Vector<T, N>> for VectorWithDefault<T, N, Policy>
where Policy: Constant<T>,

Source§

fn from(value: Vector<T, N>) -> Self

Converts to this type from the input type.
Source§

impl<T, const N: usize, Policy> From<VectorWithDefault<T, N, Policy>> for Vector<T, N>
where Policy: Constant<T>,

Source§

fn from(value: VectorWithDefault<T, N, Policy>) -> Self

Converts to this type from the input type.
Source§

impl<T: Hash, const N: usize, Policy> Hash for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + Hash,

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Ord, const N: usize, Policy> Ord for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + Ord,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl<T: PartialEq, const N: usize, Policy> PartialEq for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialOrd, const N: usize, Policy> PartialOrd for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + PartialOrd,

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T, Policy, const N: usize> Serialize for VectorWithDefault<T, N, Policy>
where Vector<T, N>: Serialize, Policy: Constant<T>,

Available on crate feature serde only.
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<T: PartialEq, const N: usize, Policy> StructuralPartialEq for VectorWithDefault<T, N, Policy>
where Policy: Constant<T> + PartialEq,

Auto Trait Implementations§

§

impl<T, const N: usize, Policy> Freeze for VectorWithDefault<T, N, Policy>
where Vector<T, N>: Freeze, PhantomData<Policy>: Freeze,

§

impl<T, const N: usize, Policy> RefUnwindSafe for VectorWithDefault<T, N, Policy>

§

impl<T, const N: usize, Policy> Send for VectorWithDefault<T, N, Policy>
where Vector<T, N>: Send, PhantomData<Policy>: Send,

§

impl<T, const N: usize, Policy> Sync for VectorWithDefault<T, N, Policy>
where Vector<T, N>: Sync, PhantomData<Policy>: Sync,

§

impl<T, const N: usize, Policy> Unpin for VectorWithDefault<T, N, Policy>
where Vector<T, N>: Unpin, PhantomData<Policy>: Unpin,

§

impl<T, const N: usize, Policy> UnsafeUnpin for VectorWithDefault<T, N, Policy>
where Vector<T, N>: UnsafeUnpin, PhantomData<Policy>: UnsafeUnpin,

§

impl<T, const N: usize, Policy> UnwindSafe for VectorWithDefault<T, N, Policy>
where Vector<T, N>: UnwindSafe, PhantomData<Policy>: 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> AnyAsync for T
where T: Any + WasmSendSync + 'static,

Source§

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

Source§

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

Source§

impl<T> Async for T
where T: WasmSend + WasmSync + 'static,

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<S, T> CastInto<T> for S
where T: CastFrom<S>,

Source§

fn cast_into(self) -> T

Source§

impl<S, T> CastRangeInto<T> for S
where T: CastRangeFrom<S>,

Source§

impl<'de, T> CfgDeserialize<'de> for T
where T: Deserialize<'de> + ?Sized,

Source§

impl<T> CfgSerialize for T
where T: Serialize + ?Sized,

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> DefaultExtension for T
where T: Default + PartialEq,

Source§

impl<T> DefaultIsTripleUnderscore for T
where T: Default,

Source§

fn ___() -> T

The Self::default() method. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Has<T> for T
where T: Copy,

Source§

fn retrieve(&self) -> T

Source§

impl<T> HasMut<T> for T

Source§

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

Source§

impl<T> HasRef<T> for T

Source§

fn retrive_ref(&self) -> &T

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> 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> PartialOrdExtension for T
where T: PartialOrd,

Source§

fn max_partial(self, other: Self) -> Self
where Self: Sized,

Using PartialOrd operator, not component wise
Source§

fn min_partial(self, other: Self) -> Self
where Self: Sized,

Using PartialOrd operator, not component wise
Source§

fn clamp_partial(self, min: Self, max: Self) -> Self
where Self: Sized,

Using PartialOrd operator, not component wise
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> SplatCoord1 for T
where T: Copy,

Source§

fn splat1(self) -> Vector1<Self>

Source§

impl<T> SplatCoord2 for T
where T: Copy,

Source§

fn splat2(self) -> Vector2<Self>

Source§

impl<T> SplatCoord3 for T
where T: Copy,

Source§

fn splat3(self) -> Vector3<Self>

Source§

impl<T> SplatCoord4 for T
where T: Copy,

Source§

fn splat4(self) -> Vector4<Self>

Source§

impl<T> ToDebug for T
where T: Debug,

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, S> TryAsRef<T> for S
where S: AsRef<T>,

Source§

type Error = Never

Source§

fn try_as_ref(&self) -> Result<&T, <S as TryAsRef<T>>::Error>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WasmSend for T
where T: Send,

Source§

impl<T> WasmSendSync for T
where T: Send + Sync,

Source§

impl<T> WasmSync for T
where T: Sync,