Skip to main content

RtfBackend

Struct RtfBackend 

Source
pub struct RtfBackend<W: Write + Debug> { /* private fields */ }
Expand description

RTF backend for document formatting

Implements the FotBuilder trait with full support for DSSSL flow objects.

Implementations§

Source§

impl<W: Write + Debug> RtfBackend<W>

Source

pub fn new(output: W) -> Result<Self>

Create a new RTF backend

§Arguments
  • output - Output stream to write RTF to
§Example
use std::fs::File;
use dazzle_backend_rtf::RtfBackend;

let file = File::create("output.rtf")?;
let backend = RtfBackend::new(file)?;
Source

pub fn finish(&mut self) -> Result<()>

Finalize the RTF document

Writes any pending content and closes the RTF structure.

Trait Implementations§

Source§

impl<W: Debug + Write + Debug> Debug for RtfBackend<W>

Source§

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

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

impl<W: Write + Debug> Drop for RtfBackend<W>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<W: Write + Debug> FotBuilder for RtfBackend<W>

Source§

fn entity(&mut self, system_id: &str, _content: &str) -> Result<()>

Create an external entity (output file) Read more
Source§

fn formatting_instruction(&mut self, data: &str) -> Result<()>

Insert backend-specific formatting instruction Read more
Source§

fn directory(&mut self, _path: &str) -> Result<()>

Create a directory Read more
Source§

fn current_output(&self) -> &str

Get the current output buffer contents Read more
Source§

fn clear_buffer(&mut self)

Clear the current output buffer Read more
Source§

fn start_paragraph(&mut self) -> Result<()>

Start a paragraph Read more
Source§

fn end_paragraph(&mut self) -> Result<()>

End a paragraph
Source§

fn literal(&mut self, text: &str) -> Result<()>

Insert literal text Read more
Source§

fn start_sequence(&mut self) -> Result<()>

Start a sequence (container for flow objects) Read more
Source§

fn end_sequence(&mut self) -> Result<()>

End a sequence
Source§

fn start_display_group(&mut self) -> Result<()>

Start a display group Read more
Source§

fn end_display_group(&mut self) -> Result<()>

End a display group
Source§

fn start_simple_page_sequence(&mut self) -> Result<()>

Start a simple page sequence (main page layout container) Read more
Source§

fn end_simple_page_sequence(&mut self) -> Result<()>

End a simple page sequence
Source§

fn start_line_field(&mut self) -> Result<()>

Start a line-field (inline text container) Read more
Source§

fn end_line_field(&mut self) -> Result<()>

End a line-field
Source§

fn current_directory(&self) -> Option<&str>

Get the current directory context Read more
Source§

fn set_current_directory(&mut self, _path: Option<String>)

Set the current directory context Read more

Auto Trait Implementations§

§

impl<W> Freeze for RtfBackend<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for RtfBackend<W>
where W: RefUnwindSafe,

§

impl<W> Send for RtfBackend<W>
where W: Send,

§

impl<W> Sync for RtfBackend<W>
where W: Sync,

§

impl<W> Unpin for RtfBackend<W>
where W: Unpin,

§

impl<W> UnsafeUnpin for RtfBackend<W>
where W: UnsafeUnpin,

§

impl<W> UnwindSafe for RtfBackend<W>
where W: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.