pub trait HasTriangles<'a>: Sized {
type Point: IsPoint;
type Normal: IsUnitVector;
type Triangle: IsTriangle<'a, Self::Point, Self::Normal>;
type TriangleTable: IsGeometryTable<Key = TriangleId, Item = Self::Triangle> + ?Sized + 'a;
// Required methods
fn triangle_table(&self) -> &Self::TriangleTable;
fn triangle_table_mut(&mut self) -> &mut Self::TriangleTable;
fn set_triangle_table(&mut self, table: &'a mut Self::TriangleTable);
// Provided methods
fn triangle_table_size(&self) -> usize { ... }
fn get_triangle(&self, id: &TriangleId) -> Option<Self::Triangle> { ... }
fn contains_triangle(&self, id: &TriangleId) -> bool { ... }
fn insert_triangle(
&mut self,
id: TriangleId,
value: Self::Triangle,
) -> Result<(), ErrorsJSL> { ... }
fn remove_triangle(&mut self, id: &TriangleId) -> Option<Self::Triangle> { ... }
}Expand description
Provides access to a borrowed triangle table.
Required Associated Types§
Sourcetype Normal: IsUnitVector
type Normal: IsUnitVector
Unit normal type used by the stored triangles.
Sourcetype Triangle: IsTriangle<'a, Self::Point, Self::Normal>
type Triangle: IsTriangle<'a, Self::Point, Self::Normal>
Triangle primitive stored in the triangle table.
Sourcetype TriangleTable: IsGeometryTable<Key = TriangleId, Item = Self::Triangle> + ?Sized + 'a
type TriangleTable: IsGeometryTable<Key = TriangleId, Item = Self::Triangle> + ?Sized + 'a
Borrowed triangle-table type.
Required Methods§
Sourcefn triangle_table(&self) -> &Self::TriangleTable
fn triangle_table(&self) -> &Self::TriangleTable
Returns an immutable reference to the triangle table.
Sourcefn triangle_table_mut(&mut self) -> &mut Self::TriangleTable
fn triangle_table_mut(&mut self) -> &mut Self::TriangleTable
Returns a mutable reference to the triangle table.
Sourcefn set_triangle_table(&mut self, table: &'a mut Self::TriangleTable)
fn set_triangle_table(&mut self, table: &'a mut Self::TriangleTable)
Rebinds the implementor to a different borrowed triangle table.
Provided Methods§
Sourcefn triangle_table_size(&self) -> usize
fn triangle_table_size(&self) -> usize
Returns the number of entries in the triangle table.
Sourcefn get_triangle(&self, id: &TriangleId) -> Option<Self::Triangle>
fn get_triangle(&self, id: &TriangleId) -> Option<Self::Triangle>
Returns the triangle stored at id.
Sourcefn contains_triangle(&self, id: &TriangleId) -> bool
fn contains_triangle(&self, id: &TriangleId) -> bool
Returns true if the triangle table contains id.
Sourcefn insert_triangle(
&mut self,
id: TriangleId,
value: Self::Triangle,
) -> Result<(), ErrorsJSL>
fn insert_triangle( &mut self, id: TriangleId, value: Self::Triangle, ) -> Result<(), ErrorsJSL>
Inserts or replaces the triangle stored at id.
Sourcefn remove_triangle(&mut self, id: &TriangleId) -> Option<Self::Triangle>
fn remove_triangle(&mut self, id: &TriangleId) -> Option<Self::Triangle>
Removes and returns the triangle stored at id, if present.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".