pub struct OperatorId { /* private fields */ }Expand description
Namespaced operator identifier.
Operators are identified by their owning module and a local name. This prevents naming conflicts between modules and provides type-safe operator references instead of string-based identification.
§Note
Operators (d, y, c) are vim-specific policy. The kernel has ZERO vim knowledge - this type lives in the vim module, not the kernel.
§Example
use reovim_module_vim::ids::{OperatorId, MODULE, DELETE};
let delete = OperatorId::new(MODULE, "delete");
assert_eq!(delete.name(), "delete");
assert_eq!(delete.module().as_str(), "vim");
// Or use the pre-defined constant
assert_eq!(DELETE.name(), "delete");Implementations§
Source§impl OperatorId
impl OperatorId
Sourcepub const fn new(module: ModuleId, name: &'static str) -> Self
pub const fn new(module: ModuleId, name: &'static str) -> Self
Create a new operator identifier from static strings.
Sourcepub fn from_qualified(qualified: String) -> Self
pub fn from_qualified(qualified: String) -> Self
Create an operator identifier from a qualified string like “module:operator”.
This method is intended for dynamic use cases like FFI where operator IDs are specified as strings at runtime.
If the string doesn’t contain ‘:’, the entire string is treated as the operator name with “unknown” as the module.
Sourcepub fn name_owned(&self) -> Cow<'static, str>
pub fn name_owned(&self) -> Cow<'static, str>
Get the local name as an owned Cow.
Trait Implementations§
Source§impl Clone for OperatorId
impl Clone for OperatorId
Source§fn clone(&self) -> OperatorId
fn clone(&self) -> OperatorId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OperatorId
impl Debug for OperatorId
Source§impl Display for OperatorId
impl Display for OperatorId
Source§impl Hash for OperatorId
impl Hash for OperatorId
Source§impl PartialEq for OperatorId
impl PartialEq for OperatorId
impl Eq for OperatorId
impl StructuralPartialEq for OperatorId
Auto Trait Implementations§
impl Freeze for OperatorId
impl RefUnwindSafe for OperatorId
impl Send for OperatorId
impl Sync for OperatorId
impl Unpin for OperatorId
impl UnsafeUnpin for OperatorId
impl UnwindSafe for OperatorId
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.