Skip to main content

ParsedEmbed

Struct ParsedEmbed 

Source
pub struct ParsedEmbed<'a> {
    pub resolved_path: &'a str,
    pub from_path: &'a str,
    pub pinned_url: &'a str,
    pub query: Option<&'a str>,
    pub section: Option<&'a str>,
    pub alias: Option<&'a str>,
    pub width: Option<&'static str>,
    pub attrs: Option<AttrBlock>,
}
Expand description

An embed that has been parsed and path-resolved, ready for rendering.

Fields§

§resolved_path: &'a str

Resolved target path, as returned by the ContentGraph.

§from_path: &'a str

The calling file’s path — identifies the referencing note, and is NOT an input to the emitted URL (see Self::pinned_url).

§pinned_url: &'a str

The URL the site serves Self::resolved_path at, pinned once by the dispatcher via ContentGraph::pinned_url. Emit it verbatim; re-deriving a URL per referencing page is moss#903 bug 3.

§query: Option<&'a str>

?query from the source wikilink, without the leading ?.

§section: Option<&'a str>

#fragment from the source wikilink, without the leading #. For .md renderers this is a heading/block-ref marker (block refs keep their ^ prefix). For every other renderer this is a URL fragment.

§alias: Option<&'a str>

|pipe-content from the source wikilink — with any spec § P9 width token already split out into Self::width. Image renderer uses this for display keywords / size; other renderers parse per their convention.

§width: Option<&'static str>

Canonical width value (body | wide | page | screen) extracted from the pipe-alias by the wikilink resolver. None means the author did not include a width token; renderers omit data-width in that case so themes can target the default via :not([data-width]).

full is normalised to screen upstream — values reaching here are already in value-space terms (see crate::media::match_width_token).

§attrs: Option<AttrBlock>

Trailing Pandoc {.class key=value} attribute block, if present.

Per Decision #8 of the unified-image-emission architecture, Pandoc- style attribute blocks are the canonical author surface for moss- vocabulary attributes; the pipe-keyword form remains as compat sugar. When both are present, the attribute block wins on typed-field conflicts (Decision #11); class lists union+dedupe.

Trait Implementations§

Source§

impl<'a> Clone for ParsedEmbed<'a>

Source§

fn clone(&self) -> ParsedEmbed<'a>

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<'a> Debug for ParsedEmbed<'a>

Source§

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

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

impl<'a> Default for ParsedEmbed<'a>

Source§

fn default() -> ParsedEmbed<'a>

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

impl<'a> Eq for ParsedEmbed<'a>

Source§

impl<'a> PartialEq for ParsedEmbed<'a>

Source§

fn eq(&self, other: &ParsedEmbed<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for ParsedEmbed<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ParsedEmbed<'a>

§

impl<'a> RefUnwindSafe for ParsedEmbed<'a>

§

impl<'a> Send for ParsedEmbed<'a>

§

impl<'a> Sync for ParsedEmbed<'a>

§

impl<'a> Unpin for ParsedEmbed<'a>

§

impl<'a> UnsafeUnpin for ParsedEmbed<'a>

§

impl<'a> UnwindSafe for ParsedEmbed<'a>

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.