pub struct Context<'o, 'c> {
pub options: &'o Options<'c>,
pub plugins: &'o Plugins<'o>,
pub anchorizer: Anchorizer,
/* 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.
Implementations§
Source§impl<'o, 'c> Context<'o, 'c>
impl<'o, 'c> Context<'o, 'c>
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_href(&mut self, buffer: &[u8]) -> Result<()>
pub fn escape_href(&mut self, buffer: &[u8]) -> Result<()>
Convenience wrapper for html::escape_href
.
Trait Implementations§
Source§impl<'o, 'c> Write for Context<'o, 'c>
impl<'o, 'c> Write for Context<'o, 'c>
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl<'o, 'c> !Freeze for Context<'o, 'c>
impl<'o, 'c> !RefUnwindSafe for Context<'o, 'c>
impl<'o, 'c> !Send for Context<'o, 'c>
impl<'o, 'c> !Sync for Context<'o, 'c>
impl<'o, 'c> Unpin for Context<'o, 'c>
impl<'o, 'c> !UnwindSafe for Context<'o, 'c>
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