Skip to main content

Repairs

Struct Repairs 

Source
pub struct Repairs {
    pub closed_emphasis: usize,
    pub closed_fence: usize,
    pub reverted_code_span: usize,
    pub dropped_marker: usize,
    pub escaped_char: usize,
    pub tag_emphasis: usize,
    pub stripped_html: usize,
    pub rewritten_bullet: usize,
    pub rewritten_table: usize,
    pub converted_marker: usize,
}
Expand description

정규화가 고친 것과 채널에 맞춰 바꾼 것의 개수. 앞 넷(고친 것)은 모델이 얼마나 자주 서식을 깨는지를, 뒤 여섯(바꾼 것)은 붙이기 전에 채널이 무엇을 바꾸는지를 재는 데 쓴다 — 둘을 따로 물으려면 Repairs::any·Repairs::changed.

Fields§

§closed_emphasis: usize

블록이 끝나도록 안 닫혀서 닫아 준 강조(**영향 범위 처럼).

§closed_fence: usize

문서 끝까지 안 닫혀서 닫아 준 코드펜스.

§reverted_code_span: usize

짝이 없어 코드가 아니라 글자로 되돌린 백틱 런.

§dropped_marker: usize

짝 잃은 채 버린 ** (꼬리** 처럼 앞이 글자인 것).

§escaped_char: usize

채널이 구문으로 읽을 글자를 탈출한 수(GitHub 의 \~·\<·\*).

§tag_emphasis: usize

마커 대신 태그로 낸 강조 — GitHub 이 마커로 못 읽는 자리(**「설정」**가)의 <strong>.

§stripped_html: usize

벗긴 원문 HTML — 그 채널이 못 그리는 태그, 주석, 줄바꿈으로 바꾼 <br>.

§rewritten_bullet: usize

다른 기호로 바꿔 쓴 목록 기호 — 불릿(* ·• → - , 텔레그램은 - → • )과 번호(1) → 1.).

§rewritten_table: usize

원문과 다른 모양으로 다시 쓴 표(구분선·칸 공백 정규화, 고정폭으로 내림).

§converted_marker: usize

다른 표기로 바꿔 쓴 강조 마커와 링크 — mrkdwn *굵게* → **굵게**, _기울임_ → *기울임*, <url|텍스트> → [텍스트](url). 마크다운을 내는 채널에서만 센다.

Implementations§

Source§

impl Repairs

Source

pub fn any(&self) -> bool

정규화가 하나라도 고쳤는가 — 앞 넷(닫아 준 강조·펜스, 되돌린 백틱, 버린 마커). 모델이 서식을 깼는지를 묻는 값이다. 채널에 맞춰 바꾼 것(탈출·불릿·표 …)은 보지 않는다 — 그건 Repairs::changed.

Source

pub fn changed(&self) -> bool

고친 것이든 채널에 맞춰 바꾼 것이든 하나라도 했는가. 출력이 원문과 달라질 수 있는지를 묻는다 (빈 줄 접기 같은 모양 고르기는 세지 않는다 — SPEC.md 5.1).

Trait Implementations§

Source§

impl Clone for Repairs

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 Repairs

Source§

impl Debug for Repairs

Source§

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

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

impl Default for Repairs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Repairs

Source§

impl PartialEq for Repairs

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 Repairs

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.