ExportObject

Trait ExportObject 

Source
pub trait ExportObject<S = ()> {
    // Required method
    fn export_to_buffer(
        &mut self,
        world: &mut World,
        buffer: &mut Vec<u8>,
        input: S,
    ) -> Result<(), Box<dyn Error>>;

    // Provided methods
    fn export_to_file(
        &mut self,
        world: &mut World,
        input: S,
    ) -> Result<(), Box<dyn Error>> { ... }
    fn filename(&self) -> impl AsRef<str> { ... }
    fn extension(&self) -> impl AsRef<str> { ... }
}

Required Methods§

Source

fn export_to_buffer( &mut self, world: &mut World, buffer: &mut Vec<u8>, input: S, ) -> Result<(), Box<dyn Error>>

Export contents to a Vec buffer, with optional parameters

Provided Methods§

Source

fn export_to_file( &mut self, world: &mut World, input: S, ) -> Result<(), Box<dyn Error>>

Export contents and save them on disk, with optional parameters

Source

fn filename(&self) -> impl AsRef<str>

Source

fn extension(&self) -> impl AsRef<str>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ExportObject for Graphviz

Source§

impl ExportObject<Entity> for TypstDiagram

Source§

impl<I: Iterator<Item = Entity>> ExportObject<(I, Entity)> for TypstTimetable