#[non_exhaustive]pub enum SetLanguageOutcome {
Ready,
Loading(String),
Unknown,
}Expand description
Outcome of SyntaxLayer::set_language_for_path.
Callers that previously tested the return value as a bool should use
outcome.is_known() for equivalent behaviour.
§Examples
use hjkl_syntax::SetLanguageOutcome;
assert!(SetLanguageOutcome::Ready.is_known());
assert!(SetLanguageOutcome::Loading("rust".to_string()).is_known());
assert!(!SetLanguageOutcome::Unknown.is_known());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 was already cached (or found fresh on disk) — installed immediately. Buffer will highlight on the next render.
Loading(String)
Grammar is being fetched/compiled on the background pool. Buffer
renders as plain text until SyntaxLayer::poll_pending_loads fires
the Ready event for this buffer. The inner String is the language
name (useful for status-line indicators).
Unknown
Extension unrecognized. No grammar — plain text only.
Implementations§
Auto Trait Implementations§
impl Freeze for SetLanguageOutcome
impl RefUnwindSafe for SetLanguageOutcome
impl Send for SetLanguageOutcome
impl Sync for SetLanguageOutcome
impl Unpin for SetLanguageOutcome
impl UnsafeUnpin for SetLanguageOutcome
impl UnwindSafe for SetLanguageOutcome
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