1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 // @has assoc_types/trait.Index.html
14 pub trait Index<I: ?Sized> {
15 // @has - '//*[@id="associatedtype.Output"]//code' 'type Output: ?Sized'
16 // @has - '//*[@id="Output.t"]//code' 'type Output: ?Sized'
18 // @has - '//*[@id="index.v"]//code' 'fn index'
19 // @has - '//*[@id="tymethod.index"]//code' \
20 // "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
21 fn index<'a>(&'a self, index: I) -> &'a Self::Output;
24 // @has assoc_types/fn.use_output.html
25 // @has - '//*[@class="rust fn"]' '-> &T::Output'
26 pub fn use_output<T: Index<usize>>(obj: &T, index: usize) -> &T::Output {
34 // @has assoc_types/fn.use_input.html
35 // @has - '//*[@class="rust fn"]' 'T::Input'
36 pub fn use_input<T: Feed>(_feed: &T, _element: T::Input) { }
38 // @has assoc_types/fn.cmp_input.html
39 // @has - '//*[@class="rust fn"]' 'where T::Input: PartialEq<U::Input>'
40 pub fn cmp_input<T: Feed, U: Feed>(a: &T::Input, b: &U::Input) -> bool
41 where T::Input: PartialEq<U::Input>