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'
17 // @has - '//*[@id="tymethod.index"]//code' \
18 // "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
19 fn index<'a>(&'a self, index: I) -> &'a Self::Output;
22 // @has assoc_types/fn.use_output.html
23 // @has - '//*[@class="rust fn"]' '-> &T::Output'
24 pub fn use_output<T: Index<usize>>(obj: &T, index: usize) -> &T::Output {
32 // @has assoc_types/fn.use_input.html
33 // @has - '//*[@class="rust fn"]' 'T::Input'
34 pub fn use_input<T: Feed>(_feed: &T, _element: T::Input) { }
36 // @has assoc_types/fn.cmp_input.html
37 // @has - '//*[@class="rust fn"]' 'where T::Input: PartialEq<U::Input>'
38 pub fn cmp_input<T: Feed, U: Feed>(a: &T::Input, b: &U::Input) -> bool
39 where T::Input: PartialEq<U::Input>