pub enum Url {
Unresolved(String),
Resolved(ResolvedUrl),
}Expand description
A URL inside the AST.
State machine: Unresolved → Resolved. The transition is performed
once per URL by crate::ast::visit::visit_urls_mut. The renderer’s
signature accepts only &ResolvedUrl; the bypass class is statically
unreachable.
Variants§
Unresolved(String)
Author input as it appears in the parsed markdown source. May carry
a moss-resolved: prefix from the upstream resolve pipeline.
Resolved(ResolvedUrl)
Classified, ready for rendering.
Implementations§
Source§impl Url
impl Url
Sourcepub fn unresolved(input: impl Into<String>) -> Self
pub fn unresolved(input: impl Into<String>) -> Self
Construct an unresolved URL from author input.
Sourcepub fn is_unresolved(&self) -> bool
pub fn is_unresolved(&self) -> bool
True if the URL has not yet been classified.
Sourcepub fn is_resolved(&self) -> bool
pub fn is_resolved(&self) -> bool
True if the URL has been classified.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Url
impl<'de> Deserialize<'de> for Url
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Url
impl StructuralPartialEq for Url
Auto Trait Implementations§
impl Freeze for Url
impl RefUnwindSafe for Url
impl Send for Url
impl Sync for Url
impl Unpin for Url
impl UnsafeUnpin for Url
impl UnwindSafe for Url
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.