#[non_exhaustive]pub enum CapabilityKind {
Transform,
Highlighter,
FenceMarkup,
FenceAnsi,
}Expand description
What a runtime plugin can contribute. The subset is chosen so that every contribution is text in and text out, which the host can check.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transform
Plain text in, plain text out: a named TextTransform. Styles on the
input are not passed, and the output is unstyled.
Highlighter
Plain text in, style spans out: a regex-style Highlighter. Each
output line is START END STYLE: byte offsets into the UTF-8 input,
on character boundaries, with END exclusive, and STYLE a rich
style such as bold red. A span the host cannot apply is skipped.
FenceMarkup
A Markdown fence’s code in, rich markup out ([bold]x[/]).
FenceAnsi
A Markdown fence’s code in, ANSI-styled text out. Only SGR (colour and attribute) sequences survive the host’s sanitizer.
Implementations§
Source§impl CapabilityKind
impl CapabilityKind
Sourcepub const ALL: [CapabilityKind; 4]
pub const ALL: [CapabilityKind; 4]
Every kind this host understands.
Sourcepub const fn code(self) -> u32
pub const fn code(self) -> u32
The number used in AbiCapability::kind.
Sourcepub fn parse(name: &str) -> Option<Self>
pub fn parse(name: &str) -> Option<Self>
The kind a manifest name spells, if this host knows it.
Sourcepub const fn produces_ansi(self) -> bool
pub const fn produces_ansi(self) -> bool
Whether the output may keep ANSI styling (after sanitizing).
Trait Implementations§
Source§impl Clone for CapabilityKind
impl Clone for CapabilityKind
impl Copy for CapabilityKind
Source§impl Debug for CapabilityKind
impl Debug for CapabilityKind
Source§impl Display for CapabilityKind
impl Display for CapabilityKind
impl Eq for CapabilityKind
Source§impl Hash for CapabilityKind
impl Hash for CapabilityKind
Source§impl Ord for CapabilityKind
impl Ord for CapabilityKind
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CapabilityKind
impl PartialEq for CapabilityKind
Source§impl PartialOrd for CapabilityKind
impl PartialOrd for CapabilityKind
impl StructuralPartialEq for CapabilityKind
Auto Trait Implementations§
impl Freeze for CapabilityKind
impl RefUnwindSafe for CapabilityKind
impl Send for CapabilityKind
impl Sync for CapabilityKind
impl Unpin for CapabilityKind
impl UnsafeUnpin for CapabilityKind
impl UnwindSafe for CapabilityKind
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.