fn methods_table<'ev>(methods: &'ev [Method], resolver: &'ev Resolver) -> Vec<Event<'ev>> {
        let mut events = vec![
            Event::Start(Tag::Heading(2)),
            Event::Text(CowStr::Borrowed("Methods")),
            Event::End(Tag::Heading(2)),
            Event::Start(Tag::Table(vec![Alignment::Left, Alignment::Left])),
            Event::Start(Tag::TableHead),
            Event::Start(Tag::TableCell),
            Event::Text(CowStr::Borrowed("returns")),
            Event::End(Tag::TableCell),
            Event::Start(Tag::TableCell),
            Event::Text(CowStr::Borrowed("method")),
            Event::End(Tag::TableCell),
            Event::End(Tag::TableHead),
        ];

        for method in methods {
            let link = format!("#func-{}", method.name);
            events.push(Event::Start(Tag::TableRow));
            events.push(Event::Start(Tag::TableCell));
            events.extend(resolver.encode_type(&method.return_type));
            events.push(Event::End(Tag::TableCell));
            events.push(Event::Start(Tag::TableCell));

            let link = Tag::Link(
                LinkType::Reference,
                link.into(),
                method.name.as_str().into(),
            );
            events.extend(vec![
                Event::Start(link.clone()),
                Event::Text(CowStr::Borrowed(&method.name)),
                Event::End(link),
                Event::Text(CowStr::Borrowed("( ")),
            ]);
            for (index, (name, typ, _)) in method.parameters.iter().enumerate() {
                events.push(Event::Text(format!("{}: ", name).into()));
                events.extend(resolver.encode_type(typ));
                if index + 1 != method.parameters.len() {
                    events.push(Event::Text(CowStr::Borrowed(", ")));
                }
            }

            events.extend(vec![
                Event::Text(CowStr::Borrowed(" )")),
                Event::End(Tag::TableCell),
                Event::End(Tag::TableRow),
            ]);
        }

        events.push(Event::End(Tag::Table(vec![
            Alignment::Left,
            Alignment::Left,
        ])));

        events
    }
/// Create a table summarizing the methods.
Create a table summarizing the methods.
Create a table summarizing the methods .
fn methods_table<'ev>(methods: &'ev [Method], resolver: &'ev Resolver) -> Vec<Event<'ev>> {
        let mut events = vec![
            Event::Start(Tag::Heading(2)),
            Event::Text(CowStr::Borrowed("Methods")),
            Event::End(Tag::Heading(2)),
            Event::Start(Tag::Table(vec![Alignment::Left, Alignment::Left])),
            Event::Start(Tag::TableHead),
            Event::Start(Tag::TableCell),
            Event::Text(CowStr::Borrowed("returns")),
            Event::End(Tag::TableCell),
            Event::Start(Tag::TableCell),
            Event::Text(CowStr::Borrowed("method")),
            Event::End(Tag::TableCell),
            Event::End(Tag::TableHead),
        ];
        for method in methods {
            let link = format!("#func-{}", method.name);
            events.push(Event::Start(Tag::TableRow));
            events.push(Event::Start(Tag::TableCell));
            events.extend(resolver.encode_type(&method.return_type));
            events.push(Event::End(Tag::TableCell));
            events.push(Event::Start(Tag::TableCell));
            let link = Tag::Link(
                LinkType::Reference,
                link.into(),
                method.name.as_str().into(),
            );
            events.extend(vec![
                Event::Start(link.clone()),
                Event::Text(CowStr::Borrowed(&method.name)),
                Event::End(link),
                Event::Text(CowStr::Borrowed("( ")),
            ]);
            for (index, (name, typ, _)) in method.parameters.iter().enumerate() {
                events.push(Event::Text(format!("{}: ", name).into()));
                events.extend(resolver.encode_type(typ));
                if index + 1 != method.parameters.len() {
                    events.push(Event::Text(CowStr::Borrowed(", ")));
                }
            }
            events.extend(vec![
                Event::Text(CowStr::Borrowed(" )")),
                Event::End(Tag::TableCell),
                Event::End(Tag::TableRow),
            ]);
        }
        events.push(Event::End(Tag::Table(vec![
            Alignment::Left,
            Alignment::Left,
        ])));
        events
    }
fn methods_table < ' ev > ( methods : & ' ev [ Method ] , resolver : & ' ev Resolver ) -> Vec < Event < ' ev > > { let mut events = vec ! [ Event Start ( Tag Heading ( 2 ) ) Event Text ( CowStr Borrowed ( " " ) ) Event End ( Tag Heading ( 2 ) ) Event Start ( Tag Table ( vec [ Alignment Left Alignment Left ] ) ) Event Start ( Tag TableHead ) Event Start ( Tag TableCell ) Event Text ( CowStr Borrowed ( " " ) ) Event End ( Tag TableCell ) Event Start ( Tag TableCell ) Event Text ( CowStr Borrowed ( " " ) ) Event End ( Tag TableCell ) Event End ( Tag TableHead ) ] ; for method in methods { let link = format ! ( " " method name ) ; events . push ( Event :: Start ( Tag :: TableRow ) ) ; events . push ( Event :: Start ( Tag :: TableCell ) ) ; events . extend ( resolver . encode_type ( & method . return_type ) ) ; events . push ( Event :: End ( Tag :: TableCell ) ) ; events . push ( Event :: Start ( Tag :: TableCell ) ) ; let link = Tag :: Link ( LinkType :: Reference , link . into ( ) , method . name . as_str ( ) . into ( ) , ) ; events . extend ( vec ! [ Event Start ( link clone ( ) ) Event Text ( CowStr Borrowed ( method name ) ) Event End ( link ) Event Text ( CowStr Borrowed ( " " ) ) ] ) ; for ( index , ( name , typ , _ ) ) in method . parameters . iter ( ) . enumerate ( ) { events . push ( Event :: Text ( format ! ( " " name ) . into ( ) ) ) ; events . extend ( resolver . encode_type ( typ ) ) ; if index + 1 != method . parameters . len ( ) { events . push ( Event :: Text ( CowStr :: Borrowed ( " " ) ) ) ; } } events . extend ( vec ! [ Event Text ( CowStr Borrowed ( " " ) ) Event End ( Tag TableCell ) Event End ( Tag TableRow ) ] ) ; } events . push ( Event :: End ( Tag :: Table ( vec ! [ Alignment Left Alignment Left ] ) ) ) ; events }
Create a table summarizing the methods.
Create a table summarizing the methods .
methods
&'ev [Method]
resolver
&'ev Resolver
methods
&'ev [Method]
resolver
&'ev Resolver