pub trait HasLines<'a>: Sized {
type Point: IsPoint;
type Line: IsLine<'a, Self::Point>;
type LineTable: IsGeometryTable<Key = LineId, Item = Self::Line> + ?Sized + 'a;
// Required methods
fn line_table(&self) -> &Self::LineTable;
fn line_table_mut(&mut self) -> &mut Self::LineTable;
fn set_line_table(&mut self, table: &'a mut Self::LineTable);
// Provided methods
fn line_table_size(&self) -> usize { ... }
fn get_line(&self, id: &LineId) -> Option<Self::Line> { ... }
fn contains_line(&self, id: &LineId) -> bool { ... }
fn insert_line(
&mut self,
id: LineId,
value: Self::Line,
) -> Result<(), ErrorsJSL> { ... }
fn remove_line(&mut self, id: &LineId) -> Option<Self::Line> { ... }
}Expand description
Provides access to a borrowed line table.
Required Associated Types§
Required Methods§
Sourcefn line_table(&self) -> &Self::LineTable
fn line_table(&self) -> &Self::LineTable
Returns an immutable reference to the line table.
Sourcefn line_table_mut(&mut self) -> &mut Self::LineTable
fn line_table_mut(&mut self) -> &mut Self::LineTable
Returns a mutable reference to the line table.
Sourcefn set_line_table(&mut self, table: &'a mut Self::LineTable)
fn set_line_table(&mut self, table: &'a mut Self::LineTable)
Rebinds the implementor to a different borrowed line table.
Provided Methods§
Sourcefn line_table_size(&self) -> usize
fn line_table_size(&self) -> usize
Returns the number of entries in the line table.
Sourcefn contains_line(&self, id: &LineId) -> bool
fn contains_line(&self, id: &LineId) -> bool
Returns true if the line table contains id.
Sourcefn insert_line(
&mut self,
id: LineId,
value: Self::Line,
) -> Result<(), ErrorsJSL>
fn insert_line( &mut self, id: LineId, value: Self::Line, ) -> Result<(), ErrorsJSL>
Inserts or replaces the line stored at id.
Sourcefn remove_line(&mut self, id: &LineId) -> Option<Self::Line>
fn remove_line(&mut self, id: &LineId) -> Option<Self::Line>
Removes and returns the line stored at id, if present.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".