// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::fmt; use std::io; #[deriving(Clone)] pub struct Layout { logo: ~str, favicon: ~str, crate: ~str, } pub struct Page<'a> { title: &'a str, ty: &'a str, root_path: &'a str, } pub fn render( dst: &mut io::Writer, layout: &Layout, page: &Page, sidebar: &S, t: &T) { write!(dst, " {title} {favicon, select, none{} other{}}
{logo, select, none{} other{ }} {sidebar}
{content}

Keyboard shortcuts

?
Show this help dialog
S
Focus the search field
Move up in search results
Move down in search results
&\\#9166;
Go to active search result

Search tricks

Prefix searches with a type followed by a colon (e.g. fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct (or str), enum, trait, typedef (or tdef).

", content = *t, root_path = page.root_path, ty = page.ty, logo = nonestr(layout.logo), title = page.title, favicon = nonestr(layout.favicon), sidebar = *sidebar, crate = layout.crate, ); } fn nonestr<'a>(s: &'a str) -> &'a str { if s == "" { "none" } else { s } }