Struct modalkit::editing::store::RegisterStore
source · pub struct RegisterStore { /* private fields */ }
Expand description
Storage for Register values.
Registers are used to save different types of values during editing:
- Recently cut and copied text (see EditAction::Delete and EditAction::Yank)
- Last used commands, searches and substitution patterns
- Recorded macros (see MacroAction::ToggleRecording)
Implementations§
source§impl RegisterStore
impl RegisterStore
sourcepub fn get(&self, reg: &Register) -> Result<RegisterCell, RegisterError>
pub fn get(&self, reg: &Register) -> Result<RegisterCell, RegisterError>
Get the current value of a Register.
If none is specified, this returns the value of Register::Unnamed.
sourcepub fn put(
&mut self,
reg: &Register,
cell: RegisterCell,
flags: RegisterPutFlags
) -> Result<(), RegisterError>
pub fn put( &mut self, reg: &Register, cell: RegisterCell, flags: RegisterPutFlags ) -> Result<(), RegisterError>
Update the current value of a Register with cell
. If none is specified, this updates
the value of Register::Unnamed.
The append
flag controls whether this should wholly replace or append to the current
value.
The del
flag indicates whether this register update is being done as part of a text
deletion in a document.
sourcepub fn get_macro(&mut self, reg: Register) -> Result<EditRope, RegisterError>
pub fn get_macro(&mut self, reg: Register) -> Result<EditRope, RegisterError>
Return the contents of a register for macro execution.
sourcepub fn get_last_macro(&self) -> Result<EditRope, RegisterError>
pub fn get_last_macro(&self) -> Result<EditRope, RegisterError>
Return the same contents as the last call to RegisterStore::get_macro.
Trait Implementations§
source§impl Default for RegisterStore
impl Default for RegisterStore
source§fn default() -> RegisterStore
fn default() -> RegisterStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RegisterStore
impl !RefUnwindSafe for RegisterStore
impl Send for RegisterStore
impl !Sync for RegisterStore
impl Unpin for RegisterStore
impl !UnwindSafe for RegisterStore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.