Struct jupyter::LanguageInfo
source · pub struct LanguageInfo {
pub language_key: String,
pub language: String,
pub version: String,
pub png_64: &'static [u8],
pub png_32: &'static [u8],
pub file_extensions: String,
pub mimetype: String,
pub lexer: String,
pub highlighter: String,
pub exporter: String,
}
Expand description
The language information and abilities provided by the kernel
Fields§
§language_key: String
Language key
language: String
Language display name
version: String
Language version
png_64: &'static [u8]
The 64×64 png logo of the language
png_32: &'static [u8]
The 32×32 png logo of the language
file_extensions: String
The file extensions of the language
e.g. *.rs; *.rsx
mimetype: String
The mimetype of the language
lexer: String
One of valid name in https://pygments.org/docs/lexers
Note that you should use the Short Name!
highlighter: String
One of valid name in https://codemirror.net/5/mode/index.html
exporter: String
Notebook exporter
Implementations§
source§impl LanguageInfo
impl LanguageInfo
sourcepub fn new<T, S>(key: T, display: S) -> Self
pub fn new<T, S>(key: T, display: S) -> Self
Create a new language with the language key and language name
sourcepub fn with_file_extensions<T, S>(self, extension: T, mime: S) -> Self
pub fn with_file_extensions<T, S>(self, extension: T, mime: S) -> Self
Set the language file extensions and mimetype
sourcepub fn with_syntax<T, S>(self, lexer: T, highlighter: S) -> Self
pub fn with_syntax<T, S>(self, lexer: T, highlighter: S) -> Self
Set the language syntax, find lexer name in https://pygments.org/docs/lexers and highlighter name in https://codemirror.net/5/mode/index.html
sourcepub fn with_version<T>(self, version: T) -> Selfwhere
T: ToString,
pub fn with_version<T>(self, version: T) -> Selfwhere
T: ToString,
Set the implement version, recommend to use env!("CARGO_PKG_VERSION")
Trait Implementations§
source§impl Clone for LanguageInfo
impl Clone for LanguageInfo
source§fn clone(&self) -> LanguageInfo
fn clone(&self) -> LanguageInfo
Returns a copy 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 moreAuto Trait Implementations§
impl RefUnwindSafe for LanguageInfo
impl Send for LanguageInfo
impl Sync for LanguageInfo
impl Unpin for LanguageInfo
impl UnwindSafe for LanguageInfo
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