[][src]Macro yew::text_format

macro_rules! text_format {
    ($type:ident based on $format:ident) => { ... };

This macro is used for a format that can be encoded as Text. It is used in conjunction with a type definition for a tuple struct with one (publically accessible) element of a generic type. Since any type that can be encoded as Text can also be encoded as Binary, it should be used with the binary_format macro.


use yew::{binary_format, text_format};

pub struct Json<T>(pub T);

text_format!(Json based on serde_json);
binary_format!(Json based on serde_json);