pub struct Doc {Show 16 fields
pub v: u32,
pub chunk: usize,
pub url: String,
pub final_url: String,
pub title: String,
pub info: Info,
pub sections: Vec<Section>,
pub top: usize,
pub links: Vec<String>,
pub anchors: Vec<String>,
pub mode: String,
pub loss: Loss,
pub tokens: Tokens,
pub cut: usize,
pub islands: usize,
pub media: Vec<Media>,
}Expand description
As Loss: a doc.json missing a field is rebuilt; one with another v or chunk too.
Fields§
§v: u32§chunk: usizeBlock size used for heading-less text (a doc built with another size is rebuilt).
url: String§final_url: String§title: String§info: Info§sections: Vec<Section>§top: usize§links: Vec<String>§anchors: Vec<String>Each link’s longest anchor text (fats uN links <words> matches it).
mode: String§loss: Loss§tokens: Tokens§cut: usizeLeft unread when the time budget ran out (0 = all of it): bytes of an HTML body, pages of a PDF.
islands: usizeThe last islands sections are islands: inert blocks in the bytes, opened on demand (clean::islands).
media: Vec<Media>Pictures and videos, best first (clean::rank).
Implementations§
Source§impl Doc
impl Doc
Sourcepub fn new(
url: &str,
final_url: &str,
title: String,
sections: Vec<Section>,
mode: &str,
) -> Doc
pub fn new( url: &str, final_url: &str, title: String, sections: Vec<Section>, mode: &str, ) -> Doc
A Doc carrying the schema version, the settings chunk, the URLs, the title, the clean-token count of
sections and the given mode; top = 1 and everything else defaults. The three builders
(build_doc, text::build, pdf::build_pdf) add the parts they alone have (info, loss, cut, links).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Doc
impl<'de> Deserialize<'de> for Doc
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>,
Auto Trait Implementations§
impl Forget for Doc
impl Freeze for Doc
impl RefUnwindSafe for Doc
impl Send for Doc
impl Sync for Doc
impl Unpin for Doc
impl UnsafeUnpin for Doc
impl UnwindSafe for Doc
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.