pub struct Reading {
pub text: String,
pub map: Vec<usize>,
}Expand description
A text in the fixed spelling of its markup: each emphasis as _x_,
each strong emphasis as **x**, each code span in the shortest run of
backticks that its content allows, and each escape that changes nothing
as the plain character, every other character as written.
Fields§
§text: StringThe text in the fixed spelling.
map: Vec<usize>map[i] is the offset in the text as written of byte i of
text, in order, and map[text.len()] the length of the text as
written.
Implementations§
Source§impl Reading
impl Reading
Sourcepub fn written(text: &str) -> Reading
pub fn written(text: &str) -> Reading
The reading of a text that reads as written, such as a line of a fence: the text itself, each byte mapped to itself.
Sourcepub fn or_written<'a>(&'a self, text: &str) -> Cow<'a, Reading>
pub fn or_written<'a>(&'a self, text: &str) -> Cow<'a, Reading>
The reading, or text as written where the reading is empty, as a
Reading left at its default by a host, or by the data of an older
version, is.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reading
impl<'de> Deserialize<'de> for Reading
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Reading, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Reading, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Reading
Source§impl Serialize for Reading
impl Serialize for Reading
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,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Reading
Auto Trait Implementations§
impl Forget for Reading
impl Freeze for Reading
impl Move for Reading
impl RefUnwindSafe for Reading
impl Send for Reading
impl Sync for Reading
impl Unpin for Reading
impl UnsafeUnpin for Reading
impl UnwindSafe for Reading
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.