@@ -2,7 +2,8 @@ use super::haystack::{Haystack, Hay, Span};
2
2
3
3
use ops:: Range ;
4
4
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).
6
7
///
7
8
/// This trait provides methods for searching for non-overlapping matches of a
8
9
/// needle starting from the front (left) of a hay.
@@ -90,23 +91,22 @@ pub unsafe trait Searcher<A: Hay + ?Sized> {
90
91
///
91
92
/// This method is used to support the following standard algorithms:
92
93
///
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 )
104
105
///
105
106
/// 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.
110
110
///
111
111
/// If the needle is not found, this method should return `None`.
112
112
///
@@ -146,13 +146,13 @@ pub unsafe trait Searcher<A: Hay + ?Sized> {
146
146
fn search ( & mut self , span : Span < & A > ) -> Option < Range < A :: Index > > ;
147
147
}
148
148
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.
151
151
///
152
152
/// This trait provides methods for matching a needle anchored at the beginning
153
153
/// of a hay.
154
154
///
155
- /// See documentation of [`Searcher`] for an example.
155
+ /// See documentation of [`Searcher`](trait.Searcher.html) for an example.
156
156
///
157
157
/// # Safety
158
158
///
@@ -163,13 +163,13 @@ pub unsafe trait Consumer<A: Hay + ?Sized> {
163
163
/// Checks if the needle can be found at the beginning of the span.
164
164
///
165
165
/// 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).
168
168
///
169
169
/// 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.
173
173
///
174
174
/// If the needle cannot be found at the beginning of the span, this method
175
175
/// should return `None`.
@@ -203,12 +203,12 @@ pub unsafe trait Consumer<A: Hay + ?Sized> {
203
203
/// Repeatedly removes prefixes of the hay which matches the needle.
204
204
///
205
205
/// 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 ).
207
207
///
208
208
/// Returns the start index of the slice after all prefixes are removed.
209
209
///
210
210
/// 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,
212
212
/// many needles allow a higher-performance specialization.
213
213
///
214
214
/// # Examples
@@ -254,19 +254,19 @@ pub unsafe trait ReverseSearcher<A: Hay + ?Sized>: Searcher<A> {
254
254
///
255
255
/// This method is used to support the following standard algorithms:
256
256
///
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 )
265
265
///
266
266
/// 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.
270
270
///
271
271
/// If the needle is not found, this method should return `None`.
272
272
///
@@ -314,13 +314,13 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
314
314
/// Checks if the needle can be found at the end of the span.
315
315
///
316
316
/// 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).
319
319
///
320
320
/// 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.
324
324
///
325
325
/// If the needle cannot be found at the end of the span, this method
326
326
/// should return `None`.
@@ -354,10 +354,10 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
354
354
/// Repeatedly removes suffixes of the hay which matches the needle.
355
355
///
356
356
/// 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 ).
358
358
///
359
359
/// A fast generic implementation in terms of
360
- /// [`.rconsume()`](ReverseConsumer:: rconsume) is provided by default.
360
+ /// [`.rconsume()`](#method. rconsume) is provided by default.
361
361
/// Nevertheless, many needles allow a higher-performance specialization.
362
362
///
363
363
/// # Examples
@@ -391,20 +391,20 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
391
391
/// A searcher which can be searched from both end with consistent results.
392
392
///
393
393
/// 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 )
408
408
///
409
409
/// # Examples
410
410
///
@@ -442,10 +442,10 @@ pub unsafe trait DoubleEndedSearcher<A: Hay + ?Sized>: ReverseSearcher<A> {}
442
442
///
443
443
/// It is used to support the following standard algorithm:
444
444
///
445
- /// * [`trim`](std::needle:: ext:: trim)
445
+ /// * [`trim`](ext/fn. trim.html )
446
446
///
447
447
/// 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 )
449
449
/// together. This trait encodes the fact that we can call these two functions in any order.
450
450
///
451
451
/// # Examples
@@ -477,11 +477,11 @@ pub unsafe trait DoubleEndedConsumer<A: Hay + ?Sized>: ReverseConsumer<A> {}
477
477
478
478
/// A needle, a type which can be converted into a searcher.
479
479
///
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
481
481
/// search with a `Needle` e.g. a `&str`. A needle is usually stateless,
482
482
/// however for efficient searching, we often need some preprocessing and
483
483
/// maintain a mutable state. The preprocessed structure is called the
484
- /// [`Searcher`] of this needle.
484
+ /// [`Searcher`](trait.Searcher.html) of this needle.
485
485
///
486
486
/// The relationship between `Searcher` and `Needle` is similar to `Iterator`
487
487
/// and `IntoIterator`.
0 commit comments