Skip to main content

Channel

Enum Channel 

Source
pub enum Channel {
    TelegramHtml,
    SlackMarkdown,
    GithubMarkdown,
    NotionMarkdown,
    Plain,
    Html,
}
Expand description

Target channel. Each channel accepts a different syntax, and the narrower output decides the parsing scope.

Variants§

§

TelegramHtml

Telegram parse_mode=HTML. Nine allowed tags: b i u s code pre a blockquote tg-spoiler. No tables or headings. 4096 characters.

§

SlackMarkdown

Slack markdown_text. Slack converts standard Markdown itself. 12,000 characters. Almost no conversion is needed; what is left is normalization and splitting.

§

GithubMarkdown

GitHub comments and PR bodies (GFM). Renders tables, headings, and strikethrough. 65,536 characters. Emits the same Markdown as Slack, but escapes the two characters GFM reads as syntax (~ <).

§

NotionMarkdown

Notion page body (Notion-flavored Markdown — the API markdown field and connectors). Four heading levels. Emits the same Markdown as GitHub, but strips inline HTML Notion cannot render (it would show as text), and writes autolinks <url> as [url](url) (the angle brackets would remain as text). Emphasis before a Korean particle is rendered by Notion as is, so it is not turned into <strong> — doing so would make the tag show as text.

§

Plain

Strips all markup. The fallback path.

§

Html

An HTML fragment for the browser. Renders headings, lists, tables, and code blocks as tags. No limit.

Assumes the output goes straight into innerHTML — all text is escaped, HTML from the source survives only as inline tags with their attributes dropped, and only http(s) and mailto links become <a>. Appending Streamer::close_open to the streaming accumulated output gives a shape that can be inserted as is.

Implementations§

Source§

impl Channel

Source

pub fn name(self) -> &'static str

The name used for corpus directories and CLI arguments. The source of truth wherever a channel is handled as a string.

Source

pub fn all() -> [Channel; 6]

Every supported channel. The corpus and the harness iterate over this list.

Source

pub fn parse(name: &str) -> Option<Channel>

Looks up a channel by name.

Source

pub fn limit(self) -> usize

This channel’s message length limit, in characters. Splitting is based on it.

Trait Implementations§

Source§

impl Clone for Channel

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Channel

Source§

impl Debug for Channel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Channel

Source§

impl PartialEq for Channel

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Channel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.