#[non_exhaustive]pub enum LoadEvent {
Ready {
id: BufferId,
name: String,
},
Failed {
id: BufferId,
name: String,
error: String,
},
}Expand description
Event emitted by SyntaxLayer::poll_pending_loads.
§Examples
use hjkl_syntax::LoadEvent;
let e = LoadEvent::Ready { id: 0, name: "rust".into() };
match e {
LoadEvent::Ready { id, name } => assert_eq!(name, "rust"),
LoadEvent::Failed { .. } => panic!("unexpected"),
_ => {}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ready
Grammar installed; trigger a redraw + re-render for id.
Failed
Load failed; buffer stays plain text.
Auto Trait Implementations§
impl Freeze for LoadEvent
impl RefUnwindSafe for LoadEvent
impl Send for LoadEvent
impl Sync for LoadEvent
impl Unpin for LoadEvent
impl UnsafeUnpin for LoadEvent
impl UnwindSafe for LoadEvent
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