Struct flo_binding::RopeBindingMut
source · [−]pub struct RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Unpin + Clone + PartialEq + Default, { /* private fields */ }
Expand description
A rope binding binds a vector of cells and attributes
A RopeBindingMut
supplies the same functionality as a RopeBinding
except it also provides the
editing functions for changing the underlying data.
Implementations
sourceimpl<Cell, Attribute> RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
impl<Cell, Attribute> RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
sourcepub fn new() -> RopeBindingMut<Cell, Attribute>
pub fn new() -> RopeBindingMut<Cell, Attribute>
Creates a new rope binding from a stream of changes
sourcepub fn read_cells<'a>(
&'a self,
range: Range<usize>
) -> impl 'a + Iterator<Item = Cell>
pub fn read_cells<'a>(
&'a self,
range: Range<usize>
) -> impl 'a + Iterator<Item = Cell>
Reads the cell values for a range in this rope
sourcepub fn read_attributes<'a>(&'a self, pos: usize) -> (Attribute, Range<usize>)
pub fn read_attributes<'a>(&'a self, pos: usize) -> (Attribute, Range<usize>)
Returns the attributes set at the specified location and their extent
sourcepub fn edit(&self, action: RopeAction<Cell, Attribute>)
pub fn edit(&self, action: RopeAction<Cell, Attribute>)
Performs the specified editing action to this rope
sourcepub fn replace<NewCells: 'static + Send + IntoIterator<Item = Cell>>(
&self,
range: Range<usize>,
new_cells: NewCells
)
pub fn replace<NewCells: 'static + Send + IntoIterator<Item = Cell>>(
&self,
range: Range<usize>,
new_cells: NewCells
)
Replaces a range of cells. The attributes applied to the new cells will be the same as the attributes that were applied to the first cell in the replacement range
sourcepub fn set_attributes(&self, range: Range<usize>, new_attributes: Attribute)
pub fn set_attributes(&self, range: Range<usize>, new_attributes: Attribute)
Sets the attributes for a range of cells
sourcepub fn replace_attributes<NewCells: 'static + Send + IntoIterator<Item = Cell>>(
&self,
range: Range<usize>,
new_cells: NewCells,
new_attributes: Attribute
)
pub fn replace_attributes<NewCells: 'static + Send + IntoIterator<Item = Cell>>(
&self,
range: Range<usize>,
new_cells: NewCells,
new_attributes: Attribute
)
Replaces a range of cells and sets the attributes for them.
Trait Implementations
sourceimpl<Cell, Attribute> Bound<AttributedRope<Cell, Attribute>> for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
impl<Cell, Attribute> Bound<AttributedRope<Cell, Attribute>> for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
Trait implemented by something that is bound to a value
sourcefn get(&self) -> AttributedRope<Cell, Attribute>
fn get(&self) -> AttributedRope<Cell, Attribute>
Retrieves the value stored by this binding
sourceimpl<Cell, Attribute> BoundRope<Cell, Attribute> for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
impl<Cell, Attribute> BoundRope<Cell, Attribute> for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
sourcefn follow_changes(&self) -> RopeStream<Cell, Attribute>
fn follow_changes(&self) -> RopeStream<Cell, Attribute>
Creates a stream that follows the changes to this rope
sourcefn follow_changes_retained(&self) -> RopeStream<Cell, Attribute>
fn follow_changes_retained(&self) -> RopeStream<Cell, Attribute>
Creates a stream that follows the changes to this rope
The stream will continue even if the rope binding is dropped (this is possible for RopeBinding as RopeBinding itself might be following a stream)
sourceimpl<Cell, Attribute> Changeable for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
impl<Cell, Attribute> Changeable for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
sourcefn when_changed(&self, what: Arc<dyn Notifiable>) -> Box<dyn Releasable>
fn when_changed(&self, what: Arc<dyn Notifiable>) -> Box<dyn Releasable>
Supplies a function to be notified when this item is changed
This event is only fired after the value has been read since the most recent change. Note that this means if the value is never read, this event may never fire. This behaviour is desirable when deferring updates as it prevents large cascades of ‘changed’ events occurring for complicated dependency trees.
The releasable that’s returned has keep_alive turned off by default, so be sure to store it in a variable or call keep_alive() to keep it around (if the event never seems to fire, this is likely to be the problem)
sourceimpl<Cell, Attribute> Clone for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
impl<Cell, Attribute> Clone for RopeBindingMut<Cell, Attribute> where
Cell: 'static + Send + Unpin + Clone + PartialEq,
Attribute: 'static + Send + Sync + Clone + Unpin + PartialEq + Default,
sourcefn clone(&self) -> RopeBindingMut<Cell, Attribute>
fn clone(&self) -> RopeBindingMut<Cell, Attribute>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<Cell, Attribute> !RefUnwindSafe for RopeBindingMut<Cell, Attribute>
impl<Cell, Attribute> Send for RopeBindingMut<Cell, Attribute>
impl<Cell, Attribute> Sync for RopeBindingMut<Cell, Attribute>
impl<Cell, Attribute> Unpin for RopeBindingMut<Cell, Attribute>
impl<Cell, Attribute> !UnwindSafe for RopeBindingMut<Cell, Attribute>
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