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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
use crate::symfony::component::finder::SplFileInfo;
/// Helper trait so `Finder::exclude` accepts both single strings and slices
/// (PHP's variadic / array argument compatibility).
pub trait IntoFinderExclude {}
impl IntoFinderExclude for &str {}
impl IntoFinderExclude for String {}
impl IntoFinderExclude for &String {}
impl IntoFinderExclude for &[String] {}
impl IntoFinderExclude for &Vec<String> {}
impl IntoFinderExclude for Vec<String> {}
#[derive(Debug)]
pub struct Finder;
impl Default for Finder {
fn default() -> Self {
Self::new()
}
}
impl Finder {
pub fn new() -> Self {
todo!()
}
pub fn create() -> Self {
todo!()
}
pub fn files(&mut self) -> &mut Self {
todo!()
}
pub fn directories(&mut self) -> &mut Self {
todo!()
}
pub fn depth(&mut self, _level: i64) -> &mut Self {
todo!()
}
pub fn r#in(&mut self, _dirs: &str) -> &mut Self {
todo!()
}
pub fn follow_links(&mut self) -> &mut Self {
todo!()
}
pub fn exclude<E: IntoFinderExclude>(&mut self, _exclude: E) -> &mut Self {
todo!()
}
pub fn ignore_vcs(&mut self, _ignore_vcs: bool) -> &mut Self {
todo!()
}
pub fn ignore_dot_files(&mut self, _ignore_dot_files: bool) -> &mut Self {
todo!()
}
pub fn not_name(&mut self, _pattern: &str) -> &mut Self {
todo!()
}
pub fn not_path(&mut self, _pattern: &str) -> &mut Self {
todo!()
}
pub fn name(&mut self, _pattern: &str) -> &mut Self {
todo!()
}
pub fn sort<F>(&mut self, _comparator: F) -> &mut Self
where
F: FnMut(&SplFileInfo, &SplFileInfo) -> i64,
{
todo!()
}
pub fn sort_by_name(&mut self) -> &mut Self {
todo!()
}
pub fn sort_by_accessed_time(&mut self) -> &mut Self {
todo!()
}
pub fn date(&mut self, _date: &str) -> &mut Self {
todo!()
}
pub fn get_iterator(&self) -> FinderIterator {
todo!()
}
pub fn iter(&self) -> impl Iterator<Item = SplFileInfo> {
todo!();
std::iter::empty()
}
/// PHP: Finder implements Countable.
pub fn len(&self) -> usize {
todo!()
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
}
impl IntoIterator for &Finder {
type Item = SplFileInfo;
type IntoIter = std::vec::IntoIter<SplFileInfo>;
fn into_iter(self) -> Self::IntoIter {
todo!()
}
}
#[derive(Debug)]
pub struct FinderIterator;
impl FinderIterator {
pub fn valid(&self) -> bool {
todo!()
}
pub fn current(&self) -> SplFileInfo {
todo!()
}
}
impl Iterator for FinderIterator {
type Item = SplFileInfo;
fn next(&mut self) -> Option<SplFileInfo> {
todo!()
}
}
impl IntoIterator for Finder {
type Item = SplFileInfo;
type IntoIter = std::vec::IntoIter<SplFileInfo>;
fn into_iter(self) -> Self::IntoIter {
todo!()
}
}
impl IntoIterator for &mut Finder {
type Item = SplFileInfo;
type IntoIter = std::vec::IntoIter<SplFileInfo>;
fn into_iter(self) -> Self::IntoIter {
todo!()
}
}
|