use super::rope_trait::*;
use super::rope_action::*;
use std::ops::{Range};
pub trait RopeMut : Rope {
fn edit(&mut self, action: RopeAction<Self::Cell, Self::Attribute>);
fn replace<NewCells: IntoIterator<Item=Self::Cell>>(&mut self, range: Range<usize>, new_cells: NewCells) {
self.edit(RopeAction::Replace(range, new_cells.into_iter().collect()));
}
fn set_attributes(&mut self, range: Range<usize>, new_attributes: Self::Attribute) {
self.edit(RopeAction::SetAttributes(range, new_attributes));
}
fn replace_attributes<NewCells: IntoIterator<Item=Self::Cell>>(&mut self, range: Range<usize>, new_cells: NewCells, new_attributes: Self::Attribute) {
self.edit(RopeAction::ReplaceAttributes(range, new_cells.into_iter().collect(), new_attributes));
}
}