pub struct StateDispatcher { /* private fields */ }
Expand description
State dispatcher that coordinates buffer state changes with subscribers
Implementations§
Source§impl StateDispatcher
impl StateDispatcher
pub fn new() -> Self
Sourcepub fn set_buffer(&mut self, buffer: Rc<RefCell<Buffer>>)
pub fn set_buffer(&mut self, buffer: Rc<RefCell<Buffer>>)
Set the buffer this dispatcher coordinates
Sourcepub fn subscribe(&mut self, subscriber: Box<dyn StateSubscriber>)
pub fn subscribe(&mut self, subscriber: Box<dyn StateSubscriber>)
Add a subscriber
Sourcepub fn dispatch(&mut self, event: StateEvent)
pub fn dispatch(&mut self, event: StateEvent)
Dispatch a state event
Sourcepub fn dispatch_mode_change(&mut self, from: AppMode, to: AppMode)
pub fn dispatch_mode_change(&mut self, from: AppMode, to: AppMode)
Dispatch a mode change event
Sourcepub fn dispatch_search_start(&mut self, search_type: SearchType)
pub fn dispatch_search_start(&mut self, search_type: SearchType)
Dispatch a search start event
Sourcepub fn dispatch_search_end(&mut self, search_type: SearchType)
pub fn dispatch_search_end(&mut self, search_type: SearchType)
Dispatch a search end event
Sourcepub fn get_event_history(&self) -> &[StateEvent]
pub fn get_event_history(&self) -> &[StateEvent]
Get event history for debugging
Auto Trait Implementations§
impl Freeze for StateDispatcher
impl !RefUnwindSafe for StateDispatcher
impl !Send for StateDispatcher
impl !Sync for StateDispatcher
impl Unpin for StateDispatcher
impl !UnwindSafe for StateDispatcher
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more