fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
where
    W: io::Write,
{
    writeln!(
        dest,
        "
        #[allow(non_camel_case_types, non_snake_case, dead_code)]
        #[derive(Clone)]
        pub struct {api} {{",
        api = super::gen_struct_name(registry.api)
    )?;

    for cmd in &registry.cmds {
        if let Some(v) = registry.aliases.get(&cmd.proto.ident) {
            writeln!(dest, "/// Fallbacks: {}", v.join(", "))?;
        }
        writeln!(dest, "pub {name}: FnPtr,", name = cmd.proto.ident)?;
    }
    writeln!(dest, "_priv: ()")?;

    writeln!(dest, "}}")
}
/// Creates a structure which stores all the `FnPtr` of the bindings.
///
/// The name of the struct corresponds to the namespace.
Creates a structure which stores all the `FnPtr` of the bindings.
The name of the struct corresponds to the namespace.
Creates a structure which stores all the ` FnPtr ` of the bindings . The name of the struct corresponds to the namespace .
fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
where
    W: io::Write,
{
    writeln!(
        dest,
        "
        #[allow(non_camel_case_types, non_snake_case, dead_code)]
        #[derive(Clone)]
        pub struct {api} {{",
        api = super::gen_struct_name(registry.api)
    )?;
    for cmd in &registry.cmds {
        if let Some(v) = registry.aliases.get(&cmd.proto.ident) {
            writeln!(dest, "/// Fallbacks: {}", v.join(", "))?;
        }
        writeln!(dest, "pub {name}: FnPtr,", name = cmd.proto.ident)?;
    }
    writeln!(dest, "_priv: ()")?;
    writeln!(dest, "}}")
}
fn write_struct < W > ( registry : & Registry , dest : & mut W ) -> io :: Result < ( ) > where W : io :: Write , { writeln ! ( dest " " api super gen_struct_name ( registry api ) ) ? ; for cmd in & registry . cmds { if let Some ( v ) = registry . aliases . get ( & cmd . proto . ident ) { writeln ! ( dest " " v join ( " " ) ) ? ; } writeln ! ( dest " " name cmd proto ident ) ? ; } writeln ! ( dest " " ) ? ; writeln ! ( dest " " ) }
Creates a structure which stores all the `FnPtr` of the bindings.
Creates a structure which stores all the ` FnPtr ` of the bindings .
registry
&Registry
dest
&mut W