pub enum TextFormat {
Show 14 variants
Bat,
Cpp,
Html,
Hlsl,
Json,
Js,
Css,
Lua,
Markdown,
Plain,
Python,
Sql,
Xml,
Yaml,
}Expand description
File format types for syntax highlighting and validation.
Based on file extension, text files are classified into different formats. This allows text editors to apply appropriate syntax highlighting, code completion, and validation rules.
§Format Detection
Format is determined by matching the file extension against the EXTENSIONS
table. If no match is found, defaults to TextFormat::Plain.
Variants§
Bat
Windows batch script (.bat).
Cpp
C++ code or GLSL shaders (.cpp, .h, .glsl, .inl, .fx).
Html
HTML documents (.html, .htm).
Hlsl
HLSL shader code (.hlsl).
Json
JSON data files (.json, .code-snippets, .code-workspace).
Js
JavaScript code (.js).
Css
CSS stylesheets (.css).
Lua
Lua scripts (.lua, .twui, .battle_script).
Markdown
Markdown documentation (.md).
Plain
Plain text with no specific format (.txt, .csv, .tsv, .log, etc.).
Python
Python scripts (.py).
Sql
SQL queries (.sql).
Xml
XML configuration and data files (.xml, .kf*, .cindyscene, etc.).
Yaml
YAML configuration files (.yaml, .yml).
Trait Implementations§
Source§impl Clone for TextFormat
impl Clone for TextFormat
Source§fn clone(&self) -> TextFormat
fn clone(&self) -> TextFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextFormat
impl Debug for TextFormat
Source§impl Default for TextFormat
Implementation of Default for TextFormat.
impl Default for TextFormat
Implementation of Default for TextFormat.
Source§impl<'de> Deserialize<'de> for TextFormat
impl<'de> Deserialize<'de> for TextFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TextFormat
impl PartialEq for TextFormat
Source§impl Serialize for TextFormat
impl Serialize for TextFormat
impl Copy for TextFormat
impl Eq for TextFormat
impl StructuralPartialEq for TextFormat
Auto Trait Implementations§
impl Freeze for TextFormat
impl RefUnwindSafe for TextFormat
impl Send for TextFormat
impl Sync for TextFormat
impl Unpin for TextFormat
impl UnsafeUnpin for TextFormat
impl UnwindSafe for TextFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.