Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

3
vendor/encase/src/impls/archery.rs vendored Normal file
View File

@@ -0,0 +1,3 @@
use crate::impl_wrapper;
impl_wrapper!(archery::SharedPointer<T, P>; (T, P: archery::SharedPointerKind); using Ref{} From{ new });

4
vendor/encase/src/impls/arrayvec.rs vendored Normal file
View File

@@ -0,0 +1,4 @@
use crate::rts_array::impl_rts_array;
// hardcap
impl_rts_array!(arrayvec::ArrayVec<T, N>; (T, const N: usize); using len truncate);

12
vendor/encase/src/impls/cgmath.rs vendored Executable file
View File

@@ -0,0 +1,12 @@
use crate::{matrix::impl_matrix, vector::impl_vector};
impl_vector!(2, cgmath::Vector2<T>; using AsRef AsMut From);
impl_vector!(3, cgmath::Vector3<T>; using AsRef AsMut From);
impl_vector!(4, cgmath::Vector4<T>; using AsRef AsMut From);
impl_vector!(2, cgmath::Point2<T>; using AsRef AsMut From);
impl_vector!(3, cgmath::Point3<T>; using AsRef AsMut From);
impl_matrix!(2, 2, cgmath::Matrix2<T>; using AsRef AsMut From);
impl_matrix!(3, 3, cgmath::Matrix3<T>; using AsRef AsMut From);
impl_matrix!(4, 4, cgmath::Matrix4<T>; using AsRef AsMut From);

54
vendor/encase/src/impls/glam.rs vendored Executable file
View File

@@ -0,0 +1,54 @@
use crate::{
matrix::{impl_matrix, AsMutMatrixParts, AsRefMatrixParts, FromMatrixParts, MatrixScalar},
vector::impl_vector,
};
impl_vector!(2, glam::Vec2, f32; using AsRef AsMut From);
impl_vector!(2, glam::UVec2, u32; using AsRef AsMut From);
impl_vector!(2, glam::IVec2, i32; using AsRef AsMut From);
impl_vector!(3, glam::Vec3, f32; using AsRef AsMut From);
impl_vector!(3, glam::UVec3, u32; using AsRef AsMut From);
impl_vector!(3, glam::IVec3, i32; using AsRef AsMut From);
impl_vector!(4, glam::Vec4, f32; using AsRef AsMut From);
impl_vector!(4, glam::UVec4, u32; using AsRef AsMut From);
impl_vector!(4, glam::IVec4, i32; using AsRef AsMut From);
impl_matrix!(2, 2, glam::Mat2, f32);
impl_matrix!(3, 3, glam::Mat3, f32);
impl_matrix!(4, 4, glam::Mat4, f32);
macro_rules! impl_matrix_traits {
($c:literal, $r:literal, $type:ty, $el_ty:ty) => {
impl AsRefMatrixParts<$el_ty, $c, $r> for $type
where
Self: AsRef<[$el_ty; $r * $c]>,
$el_ty: MatrixScalar,
{
fn as_ref_parts(&self) -> &[[$el_ty; $r]; $c] {
array_ref_to_2d_array_ref!(self.as_ref(), $el_ty, $c, $r)
}
}
impl AsMutMatrixParts<$el_ty, $c, $r> for $type
where
Self: AsMut<[$el_ty; $r * $c]>,
$el_ty: MatrixScalar,
{
fn as_mut_parts(&mut self) -> &mut [[$el_ty; $r]; $c] {
array_mut_to_2d_array_mut!(self.as_mut(), $el_ty, $c, $r)
}
}
impl FromMatrixParts<$el_ty, $c, $r> for $type {
fn from_parts(parts: [[$el_ty; $r]; $c]) -> Self {
Self::from_cols_array_2d(&parts)
}
}
};
}
impl_matrix_traits!(2, 2, glam::Mat2, f32);
impl_matrix_traits!(3, 3, glam::Mat3, f32);
impl_matrix_traits!(4, 4, glam::Mat4, f32);

3
vendor/encase/src/impls/im.rs vendored Normal file
View File

@@ -0,0 +1,3 @@
use crate::rts_array::impl_rts_array;
impl_rts_array!(im::Vector<T>; (T: Clone); using len);

3
vendor/encase/src/impls/im_rc.rs vendored Normal file
View File

@@ -0,0 +1,3 @@
use crate::rts_array::impl_rts_array;
impl_rts_array!(im_rc::Vector<T>; (T: Clone); using len);

3
vendor/encase/src/impls/imbl.rs vendored Normal file
View File

@@ -0,0 +1,3 @@
use crate::rts_array::impl_rts_array;
impl_rts_array!(imbl::Vector<T>; (T: Clone); using len);

22
vendor/encase/src/impls/mint.rs vendored Executable file
View File

@@ -0,0 +1,22 @@
use crate::{matrix::impl_matrix, vector::impl_vector};
impl_vector!(2, mint::Vector2<T>; using AsRef AsMut From);
impl_vector!(3, mint::Vector3<T>; using AsRef AsMut From);
impl_vector!(4, mint::Vector4<T>; using AsRef AsMut From);
impl_vector!(2, mint::Point2<T>; using AsRef AsMut From);
impl_vector!(3, mint::Point3<T>; using AsRef AsMut From);
impl_matrix!(2, 2, mint::ColumnMatrix2<T>; using AsRef AsMut From);
impl_matrix!(3, 2, mint::ColumnMatrix2x3<T>; using AsRef AsMut From);
impl_matrix!(4, 2, mint::ColumnMatrix2x4<T>; using AsRef AsMut From);
impl_matrix!(2, 3, mint::ColumnMatrix3x2<T>; using AsRef AsMut From);
impl_matrix!(3, 3, mint::ColumnMatrix3<T>; using AsRef AsMut From);
impl_matrix!(4, 3, mint::ColumnMatrix3x4<T>; using AsRef AsMut From);
impl_matrix!(2, 4, mint::ColumnMatrix4x2<T>; using AsRef AsMut From);
impl_matrix!(3, 4, mint::ColumnMatrix4x3<T>; using AsRef AsMut From);
impl_matrix!(4, 4, mint::ColumnMatrix4<T>; using AsRef AsMut From);

35
vendor/encase/src/impls/mod.rs vendored Normal file
View File

@@ -0,0 +1,35 @@
#[cfg(feature = "archery")]
mod archery;
#[cfg(feature = "static-rc")]
mod static_rc;
#[cfg(feature = "cgmath")]
mod cgmath;
#[cfg(feature = "glam")]
mod glam;
#[cfg(feature = "mint")]
mod mint;
#[cfg(feature = "nalgebra")]
mod nalgebra;
#[cfg(feature = "ultraviolet")]
mod ultraviolet;
#[cfg(feature = "vek")]
mod vek;
#[cfg(feature = "arrayvec")]
mod arrayvec;
#[cfg(feature = "ndarray")]
mod ndarray;
#[cfg(feature = "smallvec")]
mod smallvec;
#[cfg(feature = "tinyvec")]
mod tinyvec;
#[cfg(feature = "im")]
mod im;
#[cfg(feature = "im-rc")]
mod im_rc;
#[cfg(feature = "imbl")]
mod imbl;
#[cfg(all(feature = "rpds", feature = "archery"))]
mod rpds;

102
vendor/encase/src/impls/nalgebra.rs vendored Normal file
View File

@@ -0,0 +1,102 @@
use crate::{
matrix::{impl_matrix, AsMutMatrixParts, AsRefMatrixParts, FromMatrixParts, MatrixScalar},
vector::{impl_vector, AsMutVectorParts, AsRefVectorParts, FromVectorParts, VectorScalar},
};
impl_vector!(2, nalgebra::VectorView2<'_, T>);
impl_vector!(2, nalgebra::VectorViewMut2<'_, T>);
impl_vector!(2, nalgebra::Vector2<T>);
impl_vector!(3, nalgebra::VectorView3<'_, T>);
impl_vector!(3, nalgebra::VectorViewMut3<'_, T>);
impl_vector!(3, nalgebra::Vector3<T>);
impl_vector!(4, nalgebra::VectorView4<'_, T>);
impl_vector!(4, nalgebra::VectorViewMut4<'_, T>);
impl_vector!(4, nalgebra::Vector4<T>);
impl_matrix!(2, 2, nalgebra::MatrixView2<'_, T>);
impl_matrix!(2, 2, nalgebra::MatrixViewMut2<'_, T>);
impl_matrix!(2, 2, nalgebra::Matrix2<T>);
impl_matrix!(3, 2, nalgebra::MatrixView2x3<'_, T>);
impl_matrix!(4, 2, nalgebra::MatrixView2x4<'_, T>);
impl_matrix!(2, 3, nalgebra::MatrixView3x2<'_, T>);
impl_matrix!(3, 2, nalgebra::MatrixViewMut2x3<'_, T>);
impl_matrix!(4, 2, nalgebra::MatrixViewMut2x4<'_, T>);
impl_matrix!(2, 3, nalgebra::MatrixViewMut3x2<'_, T>);
impl_matrix!(3, 2, nalgebra::Matrix2x3<T>);
impl_matrix!(4, 2, nalgebra::Matrix2x4<T>);
impl_matrix!(2, 3, nalgebra::Matrix3x2<T>);
impl_matrix!(3, 3, nalgebra::MatrixView3<'_, T>);
impl_matrix!(3, 3, nalgebra::MatrixViewMut3<'_, T>);
impl_matrix!(3, 3, nalgebra::Matrix3<T>);
impl_matrix!(4, 3, nalgebra::MatrixView3x4<'_, T>);
impl_matrix!(2, 4, nalgebra::MatrixView4x2<'_, T>);
impl_matrix!(3, 4, nalgebra::MatrixView4x3<'_, T>);
impl_matrix!(4, 3, nalgebra::MatrixViewMut3x4<'_, T>);
impl_matrix!(2, 4, nalgebra::MatrixViewMut4x2<'_, T>);
impl_matrix!(3, 4, nalgebra::MatrixViewMut4x3<'_, T>);
impl_matrix!(4, 3, nalgebra::Matrix3x4<T>);
impl_matrix!(2, 4, nalgebra::Matrix4x2<T>);
impl_matrix!(3, 4, nalgebra::Matrix4x3<T>);
impl_matrix!(4, 4, nalgebra::MatrixView4<'_, T>);
impl_matrix!(4, 4, nalgebra::MatrixViewMut4<'_, T>);
impl_matrix!(4, 4, nalgebra::Matrix4<T>);
impl<T: VectorScalar, S, const N: usize> AsRefVectorParts<T, N>
for nalgebra::Matrix<T, nalgebra::Const<N>, nalgebra::Const<1>, S>
where
Self: AsRef<[T; N]>,
{
fn as_ref_parts(&self) -> &[T; N] {
self.as_ref()
}
}
impl<T: VectorScalar, S, const N: usize> AsMutVectorParts<T, N>
for nalgebra::Matrix<T, nalgebra::Const<N>, nalgebra::Const<1>, S>
where
Self: AsMut<[T; N]>,
{
fn as_mut_parts(&mut self) -> &mut [T; N] {
self.as_mut()
}
}
impl<T: VectorScalar, const N: usize> FromVectorParts<T, N> for nalgebra::SMatrix<T, N, 1> {
fn from_parts(parts: [T; N]) -> Self {
Self::from_array_storage(nalgebra::ArrayStorage([parts]))
}
}
impl<T: MatrixScalar, S, const C: usize, const R: usize> AsRefMatrixParts<T, C, R>
for nalgebra::Matrix<T, nalgebra::Const<R>, nalgebra::Const<C>, S>
where
Self: AsRef<[[T; R]; C]>,
{
fn as_ref_parts(&self) -> &[[T; R]; C] {
self.as_ref()
}
}
impl<T: MatrixScalar, S, const C: usize, const R: usize> AsMutMatrixParts<T, C, R>
for nalgebra::Matrix<T, nalgebra::Const<R>, nalgebra::Const<C>, S>
where
Self: AsMut<[[T; R]; C]>,
{
fn as_mut_parts(&mut self) -> &mut [[T; R]; C] {
self.as_mut()
}
}
impl<T: MatrixScalar, const C: usize, const R: usize> FromMatrixParts<T, C, R>
for nalgebra::SMatrix<T, R, C>
{
fn from_parts(parts: [[T; R]; C]) -> Self {
Self::from_array_storage(nalgebra::ArrayStorage(parts))
}
}

3
vendor/encase/src/impls/ndarray.rs vendored Normal file
View File

@@ -0,0 +1,3 @@
use crate::rts_array::impl_rts_array;
impl_rts_array!(ndarray::ArrayBase<S, D>; (T, S: ndarray::RawData<Elem = T>, D: ndarray::Dimension); using len);

12
vendor/encase/src/impls/rpds.rs vendored Normal file
View File

@@ -0,0 +1,12 @@
use crate::rts_array::{impl_rts_array, Length};
impl_rts_array!(rpds::List<T, P>; (T, P: archery::SharedPointerKind); using len);
impl_rts_array!(rpds::Vector<T, P>; (T, P: archery::SharedPointerKind); using len);
impl_rts_array!(rpds::Stack<T, P>; (T, P: archery::SharedPointerKind));
impl_rts_array!(rpds::Queue<T, P>; (T, P: archery::SharedPointerKind); using len);
impl<T, P: archery::SharedPointerKind> Length for rpds::Stack<T, P> {
fn length(&self) -> usize {
self.size()
}
}

4
vendor/encase/src/impls/smallvec.rs vendored Normal file
View File

@@ -0,0 +1,4 @@
use crate::rts_array::impl_rts_array;
// softcap
impl_rts_array!(smallvec::SmallVec<A>; (T, A: smallvec::Array<Item = T>); using len truncate);

4
vendor/encase/src/impls/static_rc.rs vendored Normal file
View File

@@ -0,0 +1,4 @@
use crate::impl_wrapper;
impl_wrapper!(static_rc::StaticRc<T, NUM, DEN>; (T: ?Sized, const NUM: usize, const DEN: usize); using Ref{});
impl_wrapper!(static_rc::StaticRc<T, N, N>; (T: ?Sized, const N: usize); using Mut{} From{ new });

7
vendor/encase/src/impls/tinyvec.rs vendored Normal file
View File

@@ -0,0 +1,7 @@
use crate::rts_array::impl_rts_array;
// hardcap
impl_rts_array!(tinyvec::ArrayVec<A>; (T, A: tinyvec::Array<Item = T>); using len truncate);
// softcap
impl_rts_array!(tinyvec::TinyVec<A>; (T, A: tinyvec::Array<Item = T>); using len truncate);

67
vendor/encase/src/impls/ultraviolet.rs vendored Executable file
View File

@@ -0,0 +1,67 @@
use crate::{
matrix::{impl_matrix, AsMutMatrixParts, AsRefMatrixParts},
vector::{impl_vector, AsMutVectorParts, AsRefVectorParts},
};
impl_vector!(2, ultraviolet::Vec2, f32; using From);
impl_vector!(2, ultraviolet::UVec2, u32; using From);
impl_vector!(2, ultraviolet::IVec2, i32; using From);
impl_vector!(3, ultraviolet::Vec3, f32; using From);
impl_vector!(3, ultraviolet::UVec3, u32; using From);
impl_vector!(3, ultraviolet::IVec3, i32; using From);
impl_vector!(4, ultraviolet::Vec4, f32; using From);
impl_vector!(4, ultraviolet::UVec4, u32; using From);
impl_vector!(4, ultraviolet::IVec4, i32; using From);
impl_matrix!(2, 2, ultraviolet::Mat2, f32; using From);
impl_matrix!(3, 3, ultraviolet::Mat3, f32; using From);
impl_matrix!(4, 4, ultraviolet::Mat4, f32; using From);
macro_rules! impl_vector_traits {
($n:literal, $type:ty, $el_ty:ty) => {
impl AsRefVectorParts<$el_ty, $n> for $type {
fn as_ref_parts(&self) -> &[$el_ty; $n] {
self.as_slice().try_into().unwrap()
}
}
impl AsMutVectorParts<$el_ty, $n> for $type {
fn as_mut_parts(&mut self) -> &mut [$el_ty; $n] {
self.as_mut_slice().try_into().unwrap()
}
}
};
}
impl_vector_traits!(2, ultraviolet::Vec2, f32);
impl_vector_traits!(2, ultraviolet::UVec2, u32);
impl_vector_traits!(2, ultraviolet::IVec2, i32);
impl_vector_traits!(3, ultraviolet::Vec3, f32);
impl_vector_traits!(3, ultraviolet::UVec3, u32);
impl_vector_traits!(3, ultraviolet::IVec3, i32);
impl_vector_traits!(4, ultraviolet::Vec4, f32);
impl_vector_traits!(4, ultraviolet::UVec4, u32);
impl_vector_traits!(4, ultraviolet::IVec4, i32);
macro_rules! impl_matrix_traits {
($c:literal, $r:literal, $type:ty, $el_ty:ty) => {
impl AsRefMatrixParts<$el_ty, $c, $r> for $type {
fn as_ref_parts(&self) -> &[[$el_ty; $r]; $c] {
array_ref_to_2d_array_ref!(self.as_array(), $el_ty, $c, $r)
}
}
impl AsMutMatrixParts<$el_ty, $c, $r> for $type {
fn as_mut_parts(&mut self) -> &mut [[$el_ty; $r]; $c] {
let array = self.as_mut_slice().try_into().unwrap();
array_mut_to_2d_array_mut!(array, $el_ty, $c, $r)
}
}
};
}
impl_matrix_traits!(2, 2, ultraviolet::Mat2, f32);
impl_matrix_traits!(3, 3, ultraviolet::Mat3, f32);
impl_matrix_traits!(4, 4, ultraviolet::Mat4, f32);

57
vendor/encase/src/impls/vek.rs vendored Executable file
View File

@@ -0,0 +1,57 @@
use crate::{
matrix::{impl_matrix, AsMutMatrixParts, AsRefMatrixParts, FromMatrixParts, MatrixScalar},
vector::{impl_vector, AsMutVectorParts, AsRefVectorParts, VectorScalar},
};
impl_vector!(2, vek::Vec2<T>; using From);
impl_vector!(3, vek::Vec3<T>; using From);
impl_vector!(4, vek::Vec4<T>; using From);
impl_matrix!(2, 2, vek::Mat2<T>);
impl_matrix!(3, 3, vek::Mat3<T>);
impl_matrix!(4, 4, vek::Mat4<T>);
macro_rules! impl_vector_traits {
($n:literal, $type:ty) => {
impl<T: VectorScalar> AsRefVectorParts<T, $n> for $type {
fn as_ref_parts(&self) -> &[T; $n] {
self.as_slice().try_into().unwrap()
}
}
impl<T: VectorScalar> AsMutVectorParts<T, $n> for $type {
fn as_mut_parts(&mut self) -> &mut [T; $n] {
self.as_mut_slice().try_into().unwrap()
}
}
};
}
impl_vector_traits!(2, vek::Vec2<T>);
impl_vector_traits!(3, vek::Vec3<T>);
impl_vector_traits!(4, vek::Vec4<T>);
macro_rules! impl_matrix_traits {
($c:literal, $r:literal, $type:ty) => {
impl<T: MatrixScalar> AsRefMatrixParts<T, $c, $r> for $type {
fn as_ref_parts(&self) -> &[[T; $r]; $c] {
let array = self.as_col_slice().try_into().unwrap();
array_ref_to_2d_array_ref!(array, T, $c, $r)
}
}
impl<T: MatrixScalar> AsMutMatrixParts<T, $c, $r> for $type {
fn as_mut_parts(&mut self) -> &mut [[T; $r]; $c] {
let array = self.as_mut_col_slice().try_into().unwrap();
array_mut_to_2d_array_mut!(array, T, $c, $r)
}
}
impl<T: MatrixScalar> FromMatrixParts<T, $c, $r> for $type {
fn from_parts(parts: [[T; $r]; $c]) -> Self {
Self::from_col_arrays(parts)
}
}
};
}
impl_matrix_traits!(2, 2, vek::Mat2<T>);
impl_matrix_traits!(3, 3, vek::Mat3<T>);
impl_matrix_traits!(4, 4, vek::Mat4<T>);