#[non_exhaustive]pub enum TargetLanguage {
Rust,
Python,
Json,
Yaml,
Toml,
Html,
Javascript,
Shell,
}
Expand description
List of target-able languages for highlighting
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.
Implementations§
Source§impl TargetLanguage
impl TargetLanguage
Sourcepub fn extension(&self) -> Option<&'static str>
pub fn extension(&self) -> Option<&'static str>
Retrieve the file extension associated with the language
Sourcepub fn parse_or_default(query: &str, default: Self) -> Self
pub fn parse_or_default(query: &str, default: Self) -> Self
Try to parse a query string as a target language. Caller must provide a default TargetLanguage, and if we can’t parse that directly, the caller will get back the default they provided
Trait Implementations§
Source§impl Clone for TargetLanguage
impl Clone for TargetLanguage
Source§fn clone(&self) -> TargetLanguage
fn clone(&self) -> TargetLanguage
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 TargetLanguage
impl Debug for TargetLanguage
Source§impl FromStr for TargetLanguage
impl FromStr for TargetLanguage
impl Copy for TargetLanguage
Auto Trait Implementations§
impl Freeze for TargetLanguage
impl RefUnwindSafe for TargetLanguage
impl Send for TargetLanguage
impl Sync for TargetLanguage
impl Unpin for TargetLanguage
impl UnwindSafe for TargetLanguage
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