pub struct ReviewTheme {
pub diff: DiffPalette,
pub syntax: SyntaxTheme,
pub markdown: MarkdownPalette,
/* private fields */
}Fields§
§diff: DiffPalette§syntax: SyntaxTheme§markdown: MarkdownPaletteImplementations§
Source§impl ReviewTheme
impl ReviewTheme
pub fn builder(id: impl Into<String>) -> ReviewThemeBuilder
Sourcepub fn from_bytes(id: ThemeId, bytes: &[u8]) -> Result<Self, ThemeError>
pub fn from_bytes(id: ThemeId, bytes: &[u8]) -> Result<Self, ThemeError>
Parses a versioned Diff theme JSON document.
Capture lookup first tries an exact name and then progressively removes dot-separated suffixes. The full parsed palette and map affect revision.
§Errors
Returns an error for malformed JSON or an unsupported schema version.
pub const fn id(&self) -> &ThemeId
pub fn revision(&self) -> Fingerprint
pub fn to_bytes(&self) -> Result<Vec<u8>, ThemeError>
Sourcepub fn catalog() -> Vec<ThemeDescriptor>
pub fn catalog() -> Vec<ThemeDescriptor>
Returns all selectable built-in themes, with stable kebab-case identifiers.
Sourcepub fn builtin(name: &str) -> Result<Self, ThemeError>
pub fn builtin(name: &str) -> Result<Self, ThemeError>
Loads a selectable built-in theme by its stable identifier.
Aliases are matched case-insensitively and with spaces or underscores normalized to dashes.
§Errors
Returns an error when no built-in theme has the supplied identifier.
Sourcepub fn sage() -> Result<Self, ThemeError>
pub fn sage() -> Result<Self, ThemeError>
Sourcepub fn ayu() -> Result<Self, ThemeError>
pub fn ayu() -> Result<Self, ThemeError>
Trait Implementations§
Source§impl Clone for ReviewTheme
impl Clone for ReviewTheme
Source§fn clone(&self) -> ReviewTheme
fn clone(&self) -> ReviewTheme
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 ReviewTheme
impl Debug for ReviewTheme
Auto Trait Implementations§
impl Freeze for ReviewTheme
impl RefUnwindSafe for ReviewTheme
impl Send for ReviewTheme
impl Sync for ReviewTheme
impl Unpin for ReviewTheme
impl UnsafeUnpin for ReviewTheme
impl UnwindSafe for ReviewTheme
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