pub struct Unit {
pub text: String,
pub reading: Reading,
pub line: usize,
pub end_line: usize,
pub nested: Vec<Block>,
pub pieces: Vec<Piece>,
}Expand description
A paragraph, an item, a row, or an image.
Fields§
§text: StringThe text as written, lines joined by one space.
reading: ReadingThe reading of text, each byte mapped to a byte of text
(TLMD_258): the text itself for a unit that is not a paragraph, an
item, a table row, or a heading inside an item or a quote.
line: usizeThe line the unit’s own text starts on: for a list item whose first
paragraph starts below its marker, after a link reference definition
or the marker alone, the line of that paragraph (TLMD_290). An item
that opens with an HTML block keeps the line of its marker.
end_line: usizeThe line the unit’s own text ends on: a paragraph’s last line, an item’s first paragraph’s last line.
nested: Vec<Block>What a list item carries beyond its own text.
pieces: Vec<Piece>Where each piece of text lies, in order: empty for a unit that is
not a paragraph, an item, a table row, or a heading inside an item or
a quote, whose pieces leave out the hashes that its text starts with.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Unit
impl<'de> Deserialize<'de> for Unit
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Unit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Unit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Unit
Source§impl Serialize for Unit
impl Serialize for Unit
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Forget for Unit
impl Freeze for Unit
impl Move for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.