Skip to main content

macro_write_element

Macro macro_write_element 

Source
macro_rules! macro_write_element {
    ($writer:expr, $name:expr, $content:expr) => { ... };
}
Expand description

Writes an XML element with the given name and content.

This macro is used internally by the macro_generate_rss macro to write individual XML elements.

§Arguments

  • $writer - The writer instance (impl std::io::Write) to write the XML element.
  • $name - The name of the XML element.
  • $content - The content of the XML element.

§Example

use rss_gen::macro_write_element;
use std::io::Cursor;

fn _doctest_main_rss_gen_src_macros_rs_153_0() -> Result<(), Box<dyn std::error::Error>> {
    let mut writer = Cursor::new(Vec::new());
    macro_write_element!(writer, "title", "My Blog").unwrap();
    Ok(())
}