1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright 2025 Umberto Gotti <umberto.gotti@umbertogotti.dev>
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
//! Skip items operator - skips the first N items from a stream.
//!
//! The `skip_items` operator allows any stream of `StreamItem<T>` to skip its first n items.
//!
//! # Arguments
//!
//! * `n` - The number of items to skip.
//!
//! # Returns
//!
//! A new stream that skips the first `n` items from the source stream.
//!
//! # Error Handling
//!
//! **Important:** Errors count as items for the purpose of skipping.
//! If you want to skip 2 items and the stream emits `[Error, Error, Value]`,
//! both errors will be skipped and only the value will be emitted.
//!
//! Use `.on_error()` before `skip_items()` if you want to handle errors before they
//! are counted in the skip count.
//!
//! # Examples
//!
//! ```rust
//! use fluxion_stream::{SkipItemsExt, IntoFluxionStream};
//! use fluxion_test_utils::Sequenced;
//! use futures::StreamExt;
//!
//! # async fn example() {
//! let (tx, rx) = async_channel::unbounded();
//! let stream = rx.into_fluxion_stream();
//!
//! let mut after_first_two = stream.skip_items(2);
//!
//! tx.try_send(Sequenced::new(1)).unwrap();
//! tx.try_send(Sequenced::new(2)).unwrap();
//! tx.try_send(Sequenced::new(3)).unwrap();
//!
//! // First two are skipped
//! assert_eq!(after_first_two.next().await.unwrap().unwrap().into_inner(), 3);
//! # }
//! ```
//!
//! # See Also
//!
//! - [`TakeItemsExt::take_items`](crate::TakeItemsExt::take_items) - Take first n items
//! - [`StartWithExt::start_with`](crate::StartWithExt::start_with) - Prepend items
pub use SkipItemsExt;
pub use SkipItemsExt;