pub struct TextObjectSpec {
pub apply: Arc<dyn Fn(&TextObjectContext<'_>) -> GrammarResult<Range> + Send + Sync>,
pub args_schema: Vec<ArgSpec>,
}Expand description
A registered text object: an evaluator that returns the span around a position.
Registered through CommandRegistry::register_text_object (or
CommandRegistry::register_plugin_text_object). Used as an operator
target (diw) and to set a Visual selection (viw).
Fields§
§apply: Arc<dyn Fn(&TextObjectContext<'_>) -> GrammarResult<Range> + Send + Sync>The evaluator: returns the selected span as a half-open range.
args_schema: Vec<ArgSpec>Per-positional-argument metadata (DESIGN.md §B.1). Empty for text objects without args (the common case).
Trait Implementations§
Source§impl Clone for TextObjectSpec
impl Clone for TextObjectSpec
Source§fn clone(&self) -> TextObjectSpec
fn clone(&self) -> TextObjectSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TextObjectSpec
impl !UnwindSafe for TextObjectSpec
impl Freeze for TextObjectSpec
impl Send for TextObjectSpec
impl Sync for TextObjectSpec
impl Unpin for TextObjectSpec
impl UnsafeUnpin for TextObjectSpec
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