MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / try_from_generic

Method try_from_generic

pysplashsurf/src/mesh.rs:117–121  ·  view source on GitHub ↗
(mut mesh: TriMesh3d<R>)

Source from the content-addressed store, hash-verified

115
116impl PyTriMesh3d {
117 pub fn try_from_generic<R: Real + Element>(mut mesh: TriMesh3d<R>) -> PyResult<Self> {
118 utils::transmute_take_into::<_, TriMesh3d<f32>, _>(&mut mesh)
119 .or_else(|| utils::transmute_take_into::<_, TriMesh3d<f64>, _>(&mut mesh))
120 .ok_or_else(utils::pyerr_unsupported_scalar)
121 }
122
123 pub fn as_f32(&self) -> Option<&TriMesh3d<f32>> {
124 match &self.inner {

Callers

nothing calls this directly

Calls 1

to_vecMethod · 0.80

Tested by

no test coverage detected