1 //- /libcore.rs crate:core
2 //! Signatures of traits, types and functions from the core lib for use in tests.
6 fn cmp(&self, other: &Self) -> Ordering;
7 fn max(self, other: Self) -> Self;
8 fn min(self, other: Self) -> Self;
9 fn clamp(self, min: Self, max: Self) -> Self;
15 fn from(t: T) -> Self;
26 pub use self::traits::{collect::IntoIterator, iterator::Iterator};
28 pub(crate) mod iterator {
29 use crate::option::Option;
32 fn next(&mut self) -> Option<Self::Item>;
33 fn by_ref(&mut self) -> &mut Self {
36 fn take(self, n: usize) -> crate::iter::Take<Self> {
37 crate::iter::Take { inner: self }
41 impl<I: Iterator> Iterator for &mut I {
43 fn next(&mut self) -> Option<I::Item> {
48 pub(crate) mod collect {
49 pub trait IntoIterator {
55 pub use self::sources::*;
56 pub(crate) mod sources {
58 use crate::option::Option::{self, *};
59 pub struct Repeat<A> {
63 pub fn repeat<T>(elt: T) -> Repeat<T> {
64 Repeat { element: elt }
67 impl<A> Iterator for Repeat<A> {
70 fn next(&mut self) -> Option<A> {
76 pub use self::adapters::*;
77 pub(crate) mod adapters {
79 use crate::option::Option::{self, *};
83 impl<I> Iterator for Take<I>
87 type Item = <I as Iterator>::Item;
88 fn next(&mut self) -> Option<<I as Iterator>::Item> {
97 pub trait Fn<Args>: FnMut<Args> {
98 extern "rust-call" fn call(&self, args: Args) -> Self::Output;
102 pub trait FnMut<Args>: FnOnce<Args> {
103 extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
106 pub trait FnOnce<Args> {
107 #[lang = "fn_once_output"]
109 extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
125 iter::{IntoIterator, Iterator},
126 ops::{Fn, FnMut, FnOnce},
127 option::Option::{self, *},