pub struct Context<'o, 'c, T = ()> {
pub options: &'o Options<'c>,
pub plugins: &'o Plugins<'o>,
pub anchorizer: Anchorizer,
pub user: T,
/* private fields */
}
Expand description
Context struct given to formatter functions as taken by
html::format_document_with_formatter
. Output can be appended to through
this struct’s Write
interface.
Fields§
§options: &'o Options<'c>
Options
in use in this render.
plugins: &'o Plugins<'o>
Plugins
in use in this render.
anchorizer: Anchorizer
Anchorizer
instance used in this render.
user: T
Any user data used by the Context
.
Implementations§
Source§impl<'o, 'c, T> Context<'o, 'c, T>
impl<'o, 'c, T> Context<'o, 'c, T>
Sourcepub fn cr(&mut self) -> Result
pub fn cr(&mut self) -> Result
If the last byte written to ts Write
interface was not a U+000A
LINE FEED, writes one. Otherwise, does nothing.
(In other words, ensures the output is at a new line.)
Sourcepub fn escape(&mut self, buffer: &str) -> Result
pub fn escape(&mut self, buffer: &str) -> Result
Convenience wrapper for html::escape
.
Sourcepub fn escape_href(&mut self, buffer: &str) -> Result
pub fn escape_href(&mut self, buffer: &str) -> Result
Convenience wrapper for html::escape_href
.
Trait Implementations§
Auto Trait Implementations§
impl<'o, 'c, T = ()> !Freeze for Context<'o, 'c, T>
impl<'o, 'c, T = ()> !RefUnwindSafe for Context<'o, 'c, T>
impl<'o, 'c, T = ()> !Send for Context<'o, 'c, T>
impl<'o, 'c, T = ()> !Sync for Context<'o, 'c, T>
impl<'o, 'c, T> Unpin for Context<'o, 'c, T>where
T: Unpin,
impl<'o, 'c, T = ()> !UnwindSafe for Context<'o, 'c, T>
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