pub struct HighlightTheme {
pub name: String,
pub appearance: ThemeMode,
pub style: HighlightThemeStyle,
}Expand description
可被编辑器和 Markdown 代码块共用的高亮主题。
Fields§
§name: String§appearance: ThemeMode§style: HighlightThemeStyleImplementations§
Source§impl HighlightTheme
impl HighlightTheme
Sourcepub fn default_dark() -> Arc<Self> ⓘ
pub fn default_dark() -> Arc<Self> ⓘ
返回默认暗色高亮主题。
Sourcepub fn default_light() -> Arc<Self> ⓘ
pub fn default_light() -> Arc<Self> ⓘ
返回默认亮色高亮主题。
Methods from Deref<Target = SyntaxColors>§
Sourcepub fn style(&self, name: &str) -> Option<HighlightStyle>
pub fn style(&self, name: &str) -> Option<HighlightStyle>
按语法作用域名称查找高亮样式。
Sourcepub fn style_for_index(&self, index: usize) -> Option<HighlightStyle>
pub fn style_for_index(&self, index: usize) -> Option<HighlightStyle>
按查询捕获索引查找高亮样式。
Trait Implementations§
Source§impl Clone for HighlightTheme
impl Clone for HighlightTheme
Source§fn clone(&self) -> HighlightTheme
fn clone(&self) -> HighlightTheme
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HighlightTheme
impl Debug for HighlightTheme
Source§impl Deref for HighlightTheme
impl Deref for HighlightTheme
Source§impl<'de> Deserialize<'de> for HighlightTheme
impl<'de> Deserialize<'de> for HighlightTheme
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for HighlightTheme
Source§impl Hash for HighlightTheme
impl Hash for HighlightTheme
Source§impl JsonSchema for HighlightTheme
impl JsonSchema for HighlightTheme
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for HighlightTheme
impl PartialEq for HighlightTheme
Source§fn eq(&self, other: &HighlightTheme) -> bool
fn eq(&self, other: &HighlightTheme) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for HighlightTheme
impl Serialize for HighlightTheme
impl StructuralPartialEq for HighlightTheme
Auto Trait Implementations§
impl Freeze for HighlightTheme
impl RefUnwindSafe for HighlightTheme
impl Send for HighlightTheme
impl Sync for HighlightTheme
impl Unpin for HighlightTheme
impl UnsafeUnpin for HighlightTheme
impl UnwindSafe for HighlightTheme
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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