pub enum InlineContent {
Empty,
Text(String),
FootnoteRef {
label: String,
},
Image {
name: String,
alt: String,
width: i64,
height: i64,
quality: i64,
},
}Expand description
Content type for an inline segment: text, image, footnote reference, or empty.
Variants§
Empty
Text(String)
FootnoteRef
A footnote reference — the marker in the prose that points at a note.
Carries only the label, never the number a reader sees. The number is a fact about document order and about which notes an export happens to include, so storing it would mean rewriting the author’s prose every time a note was inserted above it. Renderers derive it; the model never knows it.
The label need not resolve. A reference whose definition lives outside this document — which is the normal state for a host that owns note bodies itself — must survive a round trip unchanged, so nothing here requires a matching definition to exist.
Image
Fields
alt: StringAlternative text describing the image.
Carried on the model rather than derived from the resource name
because it is the image’s accessible description and its export
representation (HTML/EPUB alt, DOCX drawing description, Djot’s
![…] label) — a filename is none of those things.
#[serde(default)]: fragments are serialized onto the OS clipboard,
so a payload written by a build without this field must still
deserialize.
Trait Implementations§
Source§impl Clone for InlineContent
impl Clone for InlineContent
Source§fn clone(&self) -> InlineContent
fn clone(&self) -> InlineContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InlineContent
impl Debug for InlineContent
Source§impl Default for InlineContent
impl Default for InlineContent
Source§fn default() -> InlineContent
fn default() -> InlineContent
Source§impl<'de> Deserialize<'de> for InlineContent
impl<'de> Deserialize<'de> for InlineContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InlineContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InlineContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for InlineContent
Source§impl PartialEq for InlineContent
impl PartialEq for InlineContent
Source§impl Serialize for InlineContent
impl Serialize for InlineContent
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 InlineContent
Auto Trait Implementations§
impl Freeze for InlineContent
impl RefUnwindSafe for InlineContent
impl Send for InlineContent
impl Sync for InlineContent
impl Unpin for InlineContent
impl UnsafeUnpin for InlineContent
impl UnwindSafe for InlineContent
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.