Struct tty_form::coordinator::Coordinator
source · [−]pub struct Coordinator<'a, 'b> { /* private fields */ }Expand description
Provides controlled access to a terminal interface. Coordinates allocation of lines and segments on the screen to elements.
Implementations
sourceimpl Coordinator<'_, '_>
impl Coordinator<'_, '_>
sourcepub fn set_cursor(&mut self, cursor: RelativePosition)
pub fn set_cursor(&mut self, cursor: RelativePosition)
Set the cursor’s relative position.
sourcepub fn hide_cursor(&mut self)
pub fn hide_cursor(&mut self)
Hide the cursor.
sourcepub fn segments(&self, element_id: &ElementId) -> Vec<&Segment>
pub fn segments(&self, element_id: &ElementId) -> Vec<&Segment>
Retrieves the specified element’s inline segments.
sourcepub fn get_segment(
&self,
element_id: &ElementId,
segment_id: &SegmentId
) -> &Segment
pub fn get_segment(
&self,
element_id: &ElementId,
segment_id: &SegmentId
) -> &Segment
Retrieve the specified element’s inline segment.
sourcepub fn get_segment_mut(
&mut self,
element_id: &ElementId,
segment_id: &SegmentId
) -> &mut Segment
pub fn get_segment_mut(
&mut self,
element_id: &ElementId,
segment_id: &SegmentId
) -> &mut Segment
Retrieve a mutable reference to the specified element’s inline segment.
sourcepub fn get_inline_line_id(&self, element_id: &ElementId) -> LineId
pub fn get_inline_line_id(&self, element_id: &ElementId) -> LineId
Retrieve the specified element’s inline line ID. This ID should be considered dirty between updates and after any block line updates.
sourcepub fn add_segment(&mut self, element_id: &ElementId) -> &mut Segment
pub fn add_segment(&mut self, element_id: &ElementId) -> &mut Segment
Add an inline segment to the specified element and return a mutable reference to it.
sourcepub fn insert_segment(
&mut self,
element_id: &ElementId,
index: usize
) -> &mut Segment
pub fn insert_segment(
&mut self,
element_id: &ElementId,
index: usize
) -> &mut Segment
Insert an inline segment at the specified index and return a mutable reference to it.
sourcepub fn remove_segment(&mut self, element_id: &ElementId, segment_id: &SegmentId)
pub fn remove_segment(&mut self, element_id: &ElementId, segment_id: &SegmentId)
Remove the specified inline segment from the element.
sourcepub fn remove_segment_at(&mut self, element_id: &ElementId, index: usize)
pub fn remove_segment_at(&mut self, element_id: &ElementId, index: usize)
Remove the inline segment at the specified index from the element.
sourcepub fn lines(&self, element_id: &ElementId) -> Vec<&Line>
pub fn lines(&self, element_id: &ElementId) -> Vec<&Line>
Retrieves the specified element’s block lines.
sourcepub fn get_line(&self, _element_id: &ElementId, line_id: &LineId) -> &Line
pub fn get_line(&self, _element_id: &ElementId, line_id: &LineId) -> &Line
Retrieve a specific block line for the specified element.
sourcepub fn get_line_mut(
&mut self,
_element_id: &ElementId,
line_id: &LineId
) -> &mut Line
pub fn get_line_mut(
&mut self,
_element_id: &ElementId,
line_id: &LineId
) -> &mut Line
Retrieve a mutable reference to a specified block line for the specified element.
sourcepub fn add_line(&mut self, element_id: &ElementId) -> &mut Line
pub fn add_line(&mut self, element_id: &ElementId) -> &mut Line
Append a block line to the specified element and return a mutable reference to it.
sourcepub fn insert_line(&mut self, element_id: &ElementId, index: usize) -> &mut Line
pub fn insert_line(&mut self, element_id: &ElementId, index: usize) -> &mut Line
Insert a block line at the specified index and return a mutable reference to it.
sourcepub fn remove_line(&mut self, element_id: &ElementId, line_id: &LineId)
pub fn remove_line(&mut self, element_id: &ElementId, line_id: &LineId)
Remove the specified block line from the element.
sourcepub fn remove_line_at(&mut self, element_id: &ElementId, index: usize)
pub fn remove_line_at(&mut self, element_id: &ElementId, index: usize)
Remove a block line from the specified index.
Auto Trait Implementations
impl<'a, 'b> !RefUnwindSafe for Coordinator<'a, 'b>
impl<'a, 'b> !Send for Coordinator<'a, 'b>
impl<'a, 'b> !Sync for Coordinator<'a, 'b>
impl<'a, 'b> Unpin for Coordinator<'a, 'b> where
'b: 'a,
impl<'a, 'b> !UnwindSafe for Coordinator<'a, 'b>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more