@@ -2,7 +2,8 @@ use super::haystack::{Haystack, Hay, Span};
22
33use ops:: Range ;
44
5- /// A searcher, for searching a [`Needle`] from a [`Hay`].
5+ /// A searcher, for searching a [`Needle`](trait.Needle.html) from a
6+ /// [`Hay`](trait.Hay.html).
67///
78/// This trait provides methods for searching for non-overlapping matches of a
89/// needle starting from the front (left) of a hay.
@@ -90,23 +91,22 @@ pub unsafe trait Searcher<A: Hay + ?Sized> {
9091 ///
9192 /// This method is used to support the following standard algorithms:
9293 ///
93- /// * [`matches`](std::needle:: ext:: matches)
94- /// * [`contains`](std::needle:: ext:: contains)
95- /// * [`match_indices`](std::needle:: ext:: match_indices)
96- /// * [`find`](std::needle:: ext:: find)
97- /// * [`match_ranges`](std::needle:: ext:: match_ranges)
98- /// * [`find_range`](std::needle:: ext:: find_range)
99- /// * [`split`](std::needle:: ext:: split)
100- /// * [`split_terminator`](std::needle:: ext:: split_terminator)
101- /// * [`splitn`](std::needle:: ext:: splitn)
102- /// * [`replace_with`](std::needle:: ext:: replace_with)
103- /// * [`replacen_with`](std::needle:: ext:: replacen_with)
94+ /// * [`matches`](ext/fn. matches.html )
95+ /// * [`contains`](ext/fn. contains.html )
96+ /// * [`match_indices`](ext/fn. match_indices.html )
97+ /// * [`find`](ext/fn. find.html )
98+ /// * [`match_ranges`](ext/fn. match_ranges.html )
99+ /// * [`find_range`](ext/fn. find_range.html )
100+ /// * [`split`](ext/fn. split.html )
101+ /// * [`split_terminator`](ext/fn. split_terminator.html )
102+ /// * [`splitn`](ext/fn. splitn.html )
103+ /// * [`replace_with`](ext/fn. replace_with.html )
104+ /// * [`replacen_with`](ext/fn. replacen_with.html )
104105 ///
105106 /// The hay and the restricted range for searching can be recovered by
106- /// calling `span`[`.into_parts()`](Span::into_parts). The range returned
107- /// by this method
108- /// should be relative to the hay and must be contained within the
109- /// restricted range from the span.
107+ /// calling `span`[`.into_parts()`](struct.Span.html#method.into_parts).
108+ /// The range returned by this method should be relative to the hay and
109+ /// must be contained within the restricted range from the span.
110110 ///
111111 /// If the needle is not found, this method should return `None`.
112112 ///
@@ -146,13 +146,13 @@ pub unsafe trait Searcher<A: Hay + ?Sized> {
146146 fn search ( & mut self , span : Span < & A > ) -> Option < Range < A :: Index > > ;
147147}
148148
149- /// A consumer, for searching a [`Needle`] from a [`Hay`] anchored at the
150- /// beginnning.
149+ /// A consumer, for searching a [`Needle`](trait.Needle.html) from a
150+ /// [`Hay`](trait.Hay.html) anchored at the beginnning.
151151///
152152/// This trait provides methods for matching a needle anchored at the beginning
153153/// of a hay.
154154///
155- /// See documentation of [`Searcher`] for an example.
155+ /// See documentation of [`Searcher`](trait.Searcher.html) for an example.
156156///
157157/// # Safety
158158///
@@ -163,13 +163,13 @@ pub unsafe trait Consumer<A: Hay + ?Sized> {
163163 /// Checks if the needle can be found at the beginning of the span.
164164 ///
165165 /// This method is used to implement the standard algorithm
166- /// [`starts_with()`](std::needle:: ext:: starts_with) as well as providing the default
167- /// implementation for [`.trim_start()`](Consumer:: trim_start).
166+ /// [`starts_with()`](ext/fn. starts_with.html ) as well as providing
167+ /// the default implementation for [`.trim_start()`](#method. trim_start).
168168 ///
169169 /// The hay and the restricted range for searching can be recovered by
170- /// calling `span`[`.into_parts()`](Span:: into_parts). If a needle can be
171- /// found starting at `range.start`, this method should return the end index
172- /// of the needle relative to the hay.
170+ /// calling `span`[`.into_parts()`](struct. Span.html#method. into_parts).
171+ /// If a needle can be found starting at `range.start`, this method should
172+ /// return the end index of the needle relative to the hay.
173173 ///
174174 /// If the needle cannot be found at the beginning of the span, this method
175175 /// should return `None`.
@@ -203,12 +203,12 @@ pub unsafe trait Consumer<A: Hay + ?Sized> {
203203 /// Repeatedly removes prefixes of the hay which matches the needle.
204204 ///
205205 /// This method is used to implement the standard algorithm
206- /// [`trim_start()`](std::needle:: ext:: trim_start).
206+ /// [`trim_start()`](ext/fn. trim_start.html ).
207207 ///
208208 /// Returns the start index of the slice after all prefixes are removed.
209209 ///
210210 /// A fast generic implementation in terms of
211- /// [`.consume()`](Consumer:: consume) is provided by default. Nevertheless,
211+ /// [`.consume()`](#method. consume) is provided by default. Nevertheless,
212212 /// many needles allow a higher-performance specialization.
213213 ///
214214 /// # Examples
@@ -254,19 +254,19 @@ pub unsafe trait ReverseSearcher<A: Hay + ?Sized>: Searcher<A> {
254254 ///
255255 /// This method is used to support the following standard algorithms:
256256 ///
257- /// * [`rmatches`](std::needle:: ext:: rmatches)
258- /// * [`rmatch_indices`](std::needle:: ext:: rmatch_indices)
259- /// * [`rfind`](std::needle:: ext:: find)
260- /// * [`rmatch_ranges`](std::needle:: ext:: rmatch_ranges)
261- /// * [`rfind_range`](std::needle:: ext:: rfind_range)
262- /// * [`rsplit`](std::needle:: ext:: rsplit)
263- /// * [`rsplit_terminator`](std::needle:: ext:: rsplit_terminator)
264- /// * [`rsplitn`](std::needle:: ext:: rsplitn)
257+ /// * [`rmatches`](ext/fn. rmatches.html )
258+ /// * [`rmatch_indices`](ext/fn. rmatch_indices.html )
259+ /// * [`rfind`](ext/fn. find.html )
260+ /// * [`rmatch_ranges`](ext/fn. rmatch_ranges.html )
261+ /// * [`rfind_range`](ext/fn. rfind_range.html )
262+ /// * [`rsplit`](ext/fn. rsplit.html )
263+ /// * [`rsplit_terminator`](ext/fn. rsplit_terminator.html )
264+ /// * [`rsplitn`](ext/fn. rsplitn.html )
265265 ///
266266 /// The hay and the restricted range for searching can be recovered by
267- /// calling `span`[`.into_parts()`](Span:: into_parts). The returned range
268- /// should be relative to the hay and must be contained within the
269- /// restricted range from the span.
267+ /// calling `span`[`.into_parts()`](struct. Span.html#method. into_parts).
268+ /// The returned range should be relative to the hay and must be contained
269+ /// within the restricted range from the span.
270270 ///
271271 /// If the needle is not found, this method should return `None`.
272272 ///
@@ -314,13 +314,13 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
314314 /// Checks if the needle can be found at the end of the span.
315315 ///
316316 /// This method is used to implement the standard algorithm
317- /// [`ends_with()`](std::needle:: ext:: ends_with) as well as providing the default
318- /// implementation for [`.trim_end()`](ReverseConsumer:: trim_end).
317+ /// [`ends_with()`](ext/fn. ends_with.html ) as well as providing the default
318+ /// implementation for [`.trim_end()`](#method. trim_end).
319319 ///
320320 /// The hay and the restricted range for searching can be recovered by
321- /// calling `span`[`.into_parts()`](Span:: into_parts). If a needle can be
322- /// found ending at `range.end`, this method should return the start index
323- /// of the needle relative to the hay.
321+ /// calling `span`[`.into_parts()`](struct. Span.html#method. into_parts).
322+ /// If a needle can be found ending at `range.end`, this method should
323+ /// return the start index of the needle relative to the hay.
324324 ///
325325 /// If the needle cannot be found at the end of the span, this method
326326 /// should return `None`.
@@ -354,10 +354,10 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
354354 /// Repeatedly removes suffixes of the hay which matches the needle.
355355 ///
356356 /// This method is used to implement the standard algorithm
357- /// [`trim_end()`](std::needle:: ext:: trim_end).
357+ /// [`trim_end()`](ext/fn. trim_end.html ).
358358 ///
359359 /// A fast generic implementation in terms of
360- /// [`.rconsume()`](ReverseConsumer:: rconsume) is provided by default.
360+ /// [`.rconsume()`](#method. rconsume) is provided by default.
361361 /// Nevertheless, many needles allow a higher-performance specialization.
362362 ///
363363 /// # Examples
@@ -391,20 +391,20 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
391391/// A searcher which can be searched from both end with consistent results.
392392///
393393/// Implementing this marker trait enables the following standard algorithms to
394- /// return [`DoubleEndedIterator`](std:: iter:: DoubleEndedIterator)s:
395- ///
396- /// * [`matches`](std::needle:: ext:: matches) /
397- /// [`rmatches`](std::needle:: ext:: rmatches)
398- /// * [`match_indices`](std::needle:: ext:: match_indices) /
399- /// [`rmatch_indices`](std::needle:: ext:: rmatch_indices)
400- /// * [`match_ranges`](std::needle:: ext:: match_ranges) /
401- /// [`rmatch_ranges`](std::needle:: ext:: rmatch_ranges)
402- /// * [`split`](std::needle:: ext:: split) /
403- /// [`rsplit`](std::needle:: ext:: rsplit)
404- /// * [`split_terminator`](std::needle:: ext:: split_terminator) /
405- /// [`rsplit_terminator`](std::needle:: ext:: rsplit_terminator)
406- /// * [`splitn`](std::needle:: ext:: splitn) /
407- /// [`rsplitn`](std::needle:: ext:: rsplitn)
394+ /// return [`DoubleEndedIterator`](../ iter/trait. DoubleEndedIterator.html )s:
395+ ///
396+ /// * [`matches`](ext/fn. matches.html ) /
397+ /// [`rmatches`](ext/fn. rmatches.html )
398+ /// * [`match_indices`](ext/fn. match_indices.html ) /
399+ /// [`rmatch_indices`](ext/fn. rmatch_indices.html)`
400+ /// * [`match_ranges`](ext/fn. match_ranges.html ) /
401+ /// [`rmatch_ranges`](ext/fn. rmatch_ranges.html )
402+ /// * [`split`](ext/fn. split.html ) /
403+ /// [`rsplit`](ext/fn. rsplit.html )
404+ /// * [`split_terminator`](ext/fn. split_terminator.html ) /
405+ /// [`rsplit_terminator`](ext/fn. rsplit_terminator.html )
406+ /// * [`splitn`](ext/fn. splitn.html ) /
407+ /// [`rsplitn`](ext/fn. rsplitn.html )
408408///
409409/// # Examples
410410///
@@ -442,10 +442,10 @@ pub unsafe trait DoubleEndedSearcher<A: Hay + ?Sized>: ReverseSearcher<A> {}
442442///
443443/// It is used to support the following standard algorithm:
444444///
445- /// * [`trim`](std::needle:: ext:: trim)
445+ /// * [`trim`](ext/fn. trim.html )
446446///
447447/// The `trim` function is implemented by calling
448- /// [`trim_start`](std::needle:: ext:: trim_start) and [`trim_end`](std::needle:: ext:: trim_end)
448+ /// [`trim_start`](ext/fn. trim_start.html ) and [`trim_end`](ext/fn. trim_end.html )
449449/// together. This trait encodes the fact that we can call these two functions in any order.
450450///
451451/// # Examples
@@ -477,11 +477,11 @@ pub unsafe trait DoubleEndedConsumer<A: Hay + ?Sized>: ReverseConsumer<A> {}
477477
478478/// A needle, a type which can be converted into a searcher.
479479///
480- /// When using search algorithms like [`split()`](std::needle:: ext:: split), users will
480+ /// When using search algorithms like [`split()`](ext/fn. split.html ), users will
481481/// search with a `Needle` e.g. a `&str`. A needle is usually stateless,
482482/// however for efficient searching, we often need some preprocessing and
483483/// maintain a mutable state. The preprocessed structure is called the
484- /// [`Searcher`] of this needle.
484+ /// [`Searcher`](trait.Searcher.html) of this needle.
485485///
486486/// The relationship between `Searcher` and `Needle` is similar to `Iterator`
487487/// and `IntoIterator`.
0 commit comments