Skip to main content

HasLines

Trait HasLines 

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

Source

type Point: IsPoint

Point primitive referenced by lines in the line table.

Source

type Line: IsLine<'a, Self::Point>

Line primitive stored in the line table.

Source

type LineTable: IsGeometryTable<Key = LineId, Item = Self::Line> + ?Sized + 'a

Borrowed line-table type.

Required Methods§

Source

fn line_table(&self) -> &Self::LineTable

Returns an immutable reference to the line table.

Source

fn line_table_mut(&mut self) -> &mut Self::LineTable

Returns a mutable reference to the line table.

Source

fn set_line_table(&mut self, table: &'a mut Self::LineTable)

Rebinds the implementor to a different borrowed line table.

Provided Methods§

Source

fn line_table_size(&self) -> usize

Returns the number of entries in the line table.

Source

fn get_line(&self, id: &LineId) -> Option<Self::Line>

Returns the line stored at id.

Source

fn contains_line(&self, id: &LineId) -> bool

Returns true if the line table contains id.

Source

fn insert_line( &mut self, id: LineId, value: Self::Line, ) -> Result<(), ErrorsJSL>

Inserts or replaces the line stored at id.

Source

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".

Implementors§