pub struct OptionChanged {
pub name: String,
pub old_value: String,
pub new_value: String,
pub source: ChangeSource,
pub scope: OptionScopeId,
}Expand description
An option value changed.
Emitted after any option value is modified via OptionRegistry::set().
Handlers can react to option changes (e.g., re-render, update state).
§Example
ⓘ
use reovim_kernel::api::v1::{EventBus, EventResult, events::kernel::OptionChanged};
let bus = EventBus::new();
bus.subscribe::<OptionChanged, _>(100, |event| {
println!("Option '{}' changed from {} to {}",
event.name, event.old_value, event.new_value);
EventResult::Handled
});Fields§
§name: StringFull option name that changed.
old_value: StringPrevious value.
new_value: StringNew value.
source: ChangeSourceSource of the change.
scope: OptionScopeIdRuntime scope where the change was applied (which specific buffer or window).
This is the runtime context, NOT the option’s static scope declaration
(see OptionSpec::scope for the capability declaration).
Trait Implementations§
Source§impl Clone for OptionChanged
impl Clone for OptionChanged
Source§fn clone(&self) -> OptionChanged
fn clone(&self) -> OptionChanged
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 OptionChanged
impl Debug for OptionChanged
Source§impl Event for OptionChanged
impl Event for OptionChanged
Source§impl PartialEq for OptionChanged
impl PartialEq for OptionChanged
impl Eq for OptionChanged
impl StructuralPartialEq for OptionChanged
Auto Trait Implementations§
impl Freeze for OptionChanged
impl RefUnwindSafe for OptionChanged
impl Send for OptionChanged
impl Sync for OptionChanged
impl Unpin for OptionChanged
impl UnsafeUnpin for OptionChanged
impl UnwindSafe for OptionChanged
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