pub struct Context<'a> { /* private fields */ }Expand description
State maintained during the conversion traversal.
Passed to Rule::apply so rules can access
conversion options and list metadata.
Implementations§
Source§impl<'a> Context<'a>
impl<'a> Context<'a>
Sourcepub fn list_metadata(&self, id: NodeId) -> Option<&ListMetadata>
pub fn list_metadata(&self, id: NodeId) -> Option<&ListMetadata>
Returns the list metadata for the given node ID, if any.
Sourcepub const fn domain(&self) -> Option<&str>
pub const fn domain(&self) -> Option<&str>
Returns the base domain used for resolving relative URLs.
Sourcepub fn resolve_url<'u>(&self, raw_url: &'u str) -> Cow<'u, str>
pub fn resolve_url<'u>(&self, raw_url: &'u str) -> Cow<'u, str>
Resolves a potentially relative URL against the configured base domain.
Returns the URL unchanged (as a borrow) when no resolution is needed.
Sourcepub fn push_reference(&mut self, reference: String) -> usize
pub fn push_reference(&mut self, reference: String) -> usize
Pushes a reference-style link definition and returns the assigned link index.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnsafeUnpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
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