-
Notifications
You must be signed in to change notification settings - Fork 212
/
Rust.rs
2669 lines (2589 loc) · 80.2 KB
/
Rust.rs
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// https://www.rust-lang.org/
// https://doc.rust-lang.org/book/
// https://doc.rust-lang.org/reference/index.html
// Rust 1.38 https://doc.rust-lang.org/std/index.html
//! Keywords ===========================================================
// https://doc.rust-lang.org/std/index.html#keywords
// https://doc.rust-lang.org/reference/keywords.html
as async await
break
const continue crate
dyn
else enum extern
fn for
if impl in
let loop
match mod move mut
pub
ref return
static struct
trait type
union unsafe use
where while
false self Self super true
//! Reserved Keywords =======================================================
// https://doc.rust-lang.org/reference/keywords.html#reserved-keywords
abstract
become box
do
final
macro
override
priv
typeof try
unsized
virtual
yield
//! Primitive Types =======================================================
// https://doc.rust-lang.org/std/index.html#primitives
array
bool
char
f32 f64
i8 i16 i32 i64 i128 isize
pointer
reference
slice str
tuple
u8 u16 u32 u64 u128 unit usize
never
//! Macros ===========================================================
// https://doc.rust-lang.org/reference/macros.html
// https://doc.rust-lang.org/std/index.html#macros
macro_rules!
assert!()
assert_eq!()
assert_ne!()
cfg!()
column!()
compile_error!()
concat!()
dbg!()
debug_assert!()
debug_assert_eq!()
debug_assert_ne!()
env!()
eprint!()
eprintln!()
file!()
format!()
format_args!()
include!()
include_bytes!()
include_str!()
is_x86_feature_detected!()
line!()
module_path!()
option_env!()
panic!()
print!()
println!()
stringify!()
thread_local!()
unimplemented!()
unreachable!()
vec!()
write!()
writeln!()
//! Attribute ===========================================================
// https://doc.rust-lang.org/reference/attributes.html#built-in-attributes-index
// Conditional compilation
#[cfg(target_arch, target_feature, target_os, target_family, unix, windows, target_env, target_endian, target_pointer_width, target_vendor, test, debug_assertions, proc_macro)]
#[cfg(all(), any(), not())]
#[cfg_attr()]
// Testing
#[test]
#[ignore]
#[should_panic(expected)]
// Derive
#[derive()]
// Macros
#[macro_export]
#[macro_export(local_inner_macros)]
#[macro_use]
#[macro_use(lazy_static)]
#[proc_macro]
#[proc_macro_derive()]
#[proc_macro_attribute]
// Diagnostics
#[allow()]
#[warn()]
#[deny()]
#[forbid()]
#[deprecated]
#[deprecated()]
#[must_use]
// ABI, linking, symbols, and FFI
#[link(name, kind)]
#[link_name]
#[no_link]
#[repr(C, align(), packed())]
#![crate_type]
#![no_main]
#[export_name]
#[link_section]
#[no_mangle]
#[used]
#![crate_name]
// Code generation
#[inline]
#[inline(always, never)]
#[cold]
#[no_builtins]
#[target_feature(enable)]
// Preludes
#![no_std]
#![no_implicit_prelude]
// Modules
#[path]
// Limits
#![recursion_limit]
#![type_length_limit]
// Runtime
#[panic_handler]
#[global_allocator]
#![windows_subsystem]
//! Modules ===========================================================
// https://doc.rust-lang.org/std/index.html#modules
mod std::alloc {
struct Layout {
fn from_size_align(size: usize, align: usize) -> Result<Layout, LayoutErr>
const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Layout
fn size(&self) -> usize
fn align(&self) -> usize
fn new<T>() -> Layout
fn for_value<T>(t: &T) -> Layout
}
struct LayoutErr;
struct System;
unsafe trait GlobalAlloc {
unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
}
unsafe fn alloc(layout: Layout) -> *mut u8
unsafe fn alloc_zeroed(layout: Layout) -> *mut u8
unsafe fn dealloc(ptr: *mut u8, layout: Layout)
fn handle_alloc_error(layout: Layout) -> !
unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
}
mod std::any {
struct TypeId {
fn of<T>() -> TypeId
}
trait Any: 'static {
fn type_id(&self) -> TypeId
fn is<T>(&self) -> bool
fn downcast_ref<T>(&self) -> Option<&T>
fn downcast_mut<T>(&mut self) -> Option<&mut T>
}
}
mod std::array {
struct TryFromSliceError;
}
mod std::ascii {
struct EscapeDefault {}
fn escape_default(c: u8) -> EscapeDefault
}
mod std::borrow {
enum Cow<'a, B> {
Borrowed(&'a B),
Owned(<B as ToOwned>::Owned),
fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned
fn into_owned(self) -> <B as ToOwned>::Owned
}
trait Borrow<Borrowed> {
fn borrow(&self) -> &Borrowed
}
trait BorrowMut<Borrowed>: Borrow<Borrowed> {
fn borrow_mut(&mut self) -> &mut Borrowed
}
trait ToOwned {
type Owned: Borrow<Self>;
fn to_owned(&self) -> Self::Owned
}
}
mod std::boxed {
struct Box<T> {
fn new(x: T) -> Box<T>
fn pin(x: T) -> Pin<Box<T>>
unsafe fn from_raw(raw: *mut T) -> Box<T>
fn into_raw(b: Box<T>) -> *mut T
fn leak<'a>(b: Box<T>) -> &'a mut T
fn downcast<T>(self) -> Result<Box<T>, Box<dyn Any + 'static>>
}
}
mod std::cell {
struct BorrowError;
struct BorrowMutError
struct Cell<T> {
fn get(&self) -> T
const fn new(value: T) -> Cell<T>
fn set(&self, val: T)
fn swap(&self, other: &Cell<T>)
fn replace(&self, val: T) -> T
fn into_inner(self) -> T
const fn as_ptr(&self) -> *mut T
fn get_mut(&mut self) -> &mut T
fn from_mut(t: &mut T) -> &Cell<T>
fn take(&self) -> T
fn as_slice_of_cells(&self) -> &[Cell<T>]
}
struct Ref<'b, T> {
fn clone(orig: &Ref<'b, T>) -> Ref<'b, T>
fn map<U, F>(orig: Ref<'b, T>, f: F) -> Ref<'b, U>
fn map_split<U, V, F>(orig: Ref<'b, T>, f: F) -> (Ref<'b, U>, Ref<'b, V>)
}
struct RefCell<T> {
const fn new(value: T) -> RefCell<T>
fn into_inner(self) -> T
fn replace(&self, t: T) -> T
fn replace_with<F>(&self, f: F) -> T
fn swap(&self, other: &RefCell<T>)
fn borrow(&self) -> Ref<T>
fn try_borrow(&self) -> Result<Ref<T>, BorrowError>
fn borrow_mut(&self) -> RefMut<T>
fn try_borrow_mut(&self) -> Result<RefMut<T>, BorrowMutError>
fn as_ptr(&self) -> *mut T
fn get_mut(&mut self) -> &mut T
unsafe fn try_borrow_unguarded(&self) -> Result<&T, BorrowError>
}
struct RefMut<'b, T> {
fn map<U, F>(orig: RefMut<'b, T>, f: F) -> RefMut<'b, U>
fn map_split<U, V, F>(orig: RefMut<'b, T>, f: F) -> (RefMut<'b, U>, RefMut<'b, V>)
}
struct UnsafeCell<T> {
const fn new(value: T) -> UnsafeCell<T>
fn into_inner(self) -> T
const fn get(&self) -> *mut T
}
}
mod std::char {
// Primitive Type
fn is_digit(self, radix: u32) -> bool
fn to_digit(self, radix: u32) -> Option<u32>
fn escape_unicode(self) -> EscapeUnicode
fn escape_debug(self) -> EscapeDebug
fn escape_default(self) -> EscapeDefault
fn len_utf8(self) -> usize
fn len_utf16(self) -> usize
fn encode_utf8(self, dst: &mut [u8]) -> &mut str
fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16]
fn is_alphabetic(self) -> bool
fn is_lowercase(self) -> bool
fn is_uppercase(self) -> bool
fn is_whitespace(self) -> bool
fn is_alphanumeric(self) -> bool
fn is_control(self) -> bool
fn is_numeric(self) -> bool
fn to_lowercase(self) -> ToLowercase
fn to_uppercase(self) -> ToUppercase
const fn is_ascii(&self) -> bool
fn to_ascii_uppercase(&self) -> char
fn to_ascii_lowercase(&self) -> char
fn eq_ignore_ascii_case(&self, other: &char) -> bool
fn make_ascii_uppercase(&mut self)
fn make_ascii_lowercase(&mut self)
fn is_ascii_alphabetic(&self) -> bool
fn is_ascii_uppercase(&self) -> bool
fn is_ascii_lowercase(&self) -> bool
fn is_ascii_alphanumeric(&self) -> bool
fn is_ascii_digit(&self) -> bool
fn is_ascii_hexdigit(&self) -> bool
fn is_ascii_punctuation(&self) -> bool
fn is_ascii_graphic(&self) -> bool
fn is_ascii_whitespace(&self) -> bool
fn is_ascii_control(&self) -> bool
// Module
struct CharTryFromError;
struct DecodeUtf16<I> {}
struct DecodeUtf16Error {
fn unpaired_surrogate(&self) -> u16
}
struct EscapeDebug;
struct EscapeDefault;
struct EscapeUnicode;
struct ParseCharError;
struct ToLowercase;
struct ToUppercase;
const MAX: char
const REPLACEMENT_CHARACTER: char
fn decode_utf16<I>(iter: I) -> DecodeUtf16<<I as IntoIterator>::IntoIter>
fn from_digit(num: u32, radix: u32) -> Option<char>
fn from_u32(i: u32) -> Option<char>
unsafe fn from_u32_unchecked(i: u32) -> char
}
mod std::clone {
trait Clone {
fn clone(&self) -> Self
fn clone_from(&mut self, source: &Self)
}
}
mod std::cmp {
struct Reverse<T>(pub T);
enum Ordering {
Less,
Equal,
Greater,
fn reverse(self) -> Ordering
fn then(self, other: Ordering) -> Ordering
fn then_with<F>(self, f: F) -> Ordering
}
trait Eq: PartialEq<Self> {}
trait Ord: Eq + PartialOrd<Self> {
fn cmp(&self, other: &Self) -> Ordering
fn max(self, other: Self) -> Self
fn min(self, other: Self) -> Self
}
trait PartialEq<Rhs = Self> {
fn eq(&self, other: &Rhs) -> bool
fn ne(&self, other: &Rhs) -> bool
}
trait PartialOrd<Rhs = Self>: PartialEq<Rhs> {
fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>
fn lt(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
fn gt(&self, other: &Rhs) -> bool
fn ge(&self, other: &Rhs) -> bool
}
fn max<T>(v1: T, v2: T) -> T
fn min<T>(v1: T, v2: T) -> T
}
mod std::collections {
struct BTreeMap<K, V> {
fn new() -> BTreeMap<K, V>
fn clear(&mut self)
fn get<Q>(&self, key: &Q) -> Option<&V>
fn contains_key<Q>(&self, key: &Q) -> bool
fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
fn insert(&mut self, key: K, value: V) -> Option<V>
fn remove<Q>(&mut self, key: &Q) -> Option<V>
fn append(&mut self, other: &mut BTreeMap<K, V>)
fn range<T, R>(&self, range: R) -> Range<K, V>
fn range_mut<T, R>(&mut self, range: R) -> RangeMut<K, V>
fn entry(&mut self, key: K) -> Entry<K, V>
fn split_off<Q>(&mut self, key: &Q) -> BTreeMap<K, V>
fn iter(&self) -> Iter<K, V>
fn iter_mut(&mut self) -> IterMut<K, V>
fn keys(&'a self) -> Keys<'a, K, V>
fn values(&'a self) -> Values<'a, K, V>
fn values_mut(&mut self) -> ValuesMut<K, V>
fn len(&self) -> usize
fn is_empty(&self) -> bool
}
struct BTreeSet<T> {
fn new() -> BTreeSet<T>
fn range<K, R>(&self, range: R) -> Range<T>
fn difference(&'a self, other: &'a BTreeSet<T>) -> Difference<'a, T>
fn symmetric_difference(&'a self, other: &'a BTreeSet<T>) -> SymmetricDifference<'a, T>
fn intersection(&'a self, other: &'a BTreeSet<T>) -> Intersection<'a, T>
fn union(&'a self, other: &'a BTreeSet<T>) -> Union<'a, T>
fn clear(&mut self)
fn contains<Q>(&self, value: &Q) -> bool
fn get<Q>(&self, value: &Q) -> Option<&T>
fn is_disjoint(&self, other: &BTreeSet<T>) -> bool
fn is_subset(&self, other: &BTreeSet<T>) -> bool
fn is_superset(&self, other: &BTreeSet<T>) -> bool
fn insert(&mut self, value: T) -> bool
fn replace(&mut self, value: T) -> Option<T>
fn remove<Q>(&mut self, value: &Q) -> bool
fn take<Q>(&mut self, value: &Q) -> Option<T>
fn append(&mut self, other: &mut BTreeSet<T>)
fn split_off<Q>(&mut self, key: &Q) -> BTreeSet<T>
fn iter(&self) -> Iter<T>
fn len(&self) -> usize
fn is_empty(&self) -> bool
}
struct BinaryHeap<T> {
fn new() -> BinaryHeap<T>
fn with_capacity(capacity: usize) -> BinaryHeap<T>
fn peek_mut(&mut self) -> Option<PeekMut<T>>
fn pop(&mut self) -> Option<T>
fn push(&mut self, item: T)
fn into_sorted_vec(self) -> Vec<T>
fn append(&mut self, other: &mut BinaryHeap<T>)
fn iter(&self) -> Iter<T>
fn peek(&self) -> Option<&T>
fn capacity(&self) -> usize
fn reserve_exact(&mut self, additional: usize)
fn reserve(&mut self, additional: usize)
fn shrink_to_fit(&mut self)
fn into_vec(self) -> Vec<T>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn drain(&mut self) -> Drain<T>
fn clear(&mut self)
}
struct HashMap<K, V, S = RandomState> {
fn new() -> HashMap<K, V, RandomState>
fn with_capacity(capacity: usize) -> HashMap<K, V, RandomState>
fn capacity(&self) -> usize
fn keys(&self) -> Keys<K, V>
fn values(&self) -> Values<K, V>
fn values_mut(&mut self) -> ValuesMut<K, V>
fn iter(&self) -> Iter<K, V>
fn iter_mut(&mut self) -> IterMut<K, V>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn drain(&mut self) -> Drain<K, V>
fn clear(&mut self)
fn with_hasher(hash_builder: S) -> HashMap<K, V, S>
fn with_capacity_and_hasher(capacity: usize, hash_builder: S) -> HashMap<K, V, S>
fn hasher(&self) -> &S
fn reserve(&mut self, additional: usize)
fn shrink_to_fit(&mut self)
fn entry(&mut self, key: K) -> Entry<K, V>
fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V>
fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V>
fn insert(&mut self, k: K, v: V) -> Option<V>
fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<V>
fn remove_entry<Q: ?Sized>(&mut self, k: &Q) -> Option<(K, V)>
fn retain<F>(&mut self, f: F)
}
struct HashSet<T, S = RandomState> {
fn new() -> HashSet<T, RandomState>
fn with_capacity(capacity: usize) -> HashSet<T, RandomState>
fn capacity(&self) -> usize
fn iter(&self) -> Iter<T>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn drain(&mut self) -> Drain<T>
fn clear(&mut self)
fn with_hasher(hasher: S) -> HashSet<T, S>
fn with_capacity_and_hasher(capacity: usize, hasher: S) -> HashSet<T, S>
fn hasher(&self) -> &S
fn reserve(&mut self, additional: usize)
fn shrink_to_fit(&mut self)
fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S>
fn symmetric_difference<'a>(&'a self, other: &'a HashSet<T, S>) -> SymmetricDifference<'a, T, S>
fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S>
fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S>
fn contains<Q: ?Sized>(&self, value: &Q) -> bool
fn get<Q: ?Sized>(&self, value: &Q) -> Option<&T>
fn is_disjoint(&self, other: &HashSet<T, S>) -> bool
fn is_subset(&self, other: &HashSet<T, S>) -> bool
fn is_superset(&self, other: &HashSet<T, S>) -> bool
fn insert(&mut self, value: T) -> bool
fn replace(&mut self, value: T) -> Option<T>
fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool
fn take<Q: ?Sized>(&mut self, value: &Q) -> Option<T>
fn retain<F>(&mut self, f: F)
}
struct LinkedList<T> {
fn new() -> LinkedList<T>
fn append(&mut self, other: &mut LinkedList<T>)
fn iter(&self) -> Iter<T>
fn iter_mut(&mut self) -> IterMut<T>
fn is_empty(&self) -> bool
fn len(&self) -> usize
fn clear(&mut self)
fn contains(&self, x: &T) -> bool
fn front(&self) -> Option<&T>
fn front_mut(&mut self) -> Option<&mut T>
fn back(&self) -> Option<&T>
fn back_mut(&mut self) -> Option<&mut T>
fn push_front(&mut self, elt: T)
fn pop_front(&mut self) -> Option<T>
fn push_back(&mut self, elt: T)
fn pop_back(&mut self) -> Option<T>
fn split_off(&mut self, at: usize) -> LinkedList<T>
}
struct VecDeque<T> {
fn new() -> VecDeque<T>
fn with_capacity(capacity: usize) -> VecDeque<T>
fn get(&self, index: usize) -> Option<&T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn swap(&mut self, i: usize, j: usize)
fn capacity(&self) -> usize
fn reserve_exact(&mut self, additional: usize)
fn reserve(&mut self, additional: usize)
fn shrink_to_fit(&mut self)
fn truncate(&mut self, len: usize)
fn iter(&self) -> Iter<T>
fn iter_mut(&mut self) -> IterMut<T>
fn as_slices(&self) -> (&[T], &[T])
fn as_mut_slices(&mut self) -> (&mut [T], &mut [T])
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn drain<R>(&mut self, range: R) -> Drain<T>
fn clear(&mut self)
fn contains(&self, x: &T) -> bool
fn front(&self) -> Option<&T>
fn front_mut(&mut self) -> Option<&mut T>
fn back(&self) -> Option<&T>
fn back_mut(&mut self) -> Option<&mut T>
fn pop_front(&mut self) -> Option<T>
fn push_front(&mut self, value: T)
fn push_back(&mut self, value: T)
fn pop_back(&mut self) -> Option<T>
fn swap_remove_back(&mut self, index: usize) -> Option<T>
fn swap_remove_front(&mut self, index: usize) -> Option<T>
fn insert(&mut self, index: usize, value: T)
fn remove(&mut self, index: usize) -> Option<T>
fn split_off(&mut self, at: usize) -> VecDeque<T>
fn append(&mut self, other: &mut VecDeque<T>)
fn retain<F>(&mut self, f: F)
fn resize_with<impl FnMut() -> T>(&mut self, new_len: usize, generator: impl FnMut() -> T)
fn rotate_left(&mut self, mid: usize)
fn rotate_right(&mut self, k: usize)
fn resize(&mut self, new_len: usize, value: T)
}
}
mod std::convert {
enum Infallible;
trait AsMut<T> {
fn as_mut(&mut self) -> &mut T
}
trait AsRef<T> {
fn as_ref(&self) -> &T
}
trait From<T> {
fn from(T) -> Self
}
trait Into<T> {
fn into(self) -> T
}
trait TryFrom<T> {
type Error;
fn try_from(value: T) -> Result<Self, Self::Error>
}
trait TryInto<T> {
type Error;
fn try_into(self) -> Result<T, Self::Error>
}
const fn identity<T>(x: T) -> T
}
mod std::default {
trait Default {
fn default() -> Self;
}
}
mod std::env {
mod consts {
const ARCH: &str
const DLL_EXTENSION: &str
const DLL_PREFIX: &str
const DLL_SUFFIX: &str
const EXE_EXTENSION: &str
const EXE_SUFFIX: &str
const FAMILY: &str
const OS: &str
}
struct Args;
struct ArgsOs;
struct JoinPathsError;
struct SplitPaths<'a>;
struct Vars;
struct VarsOs;
enum VarError {
NotPresent,
NotUnicode(OsString),
}
fn args() -> Args
fn args_os() -> ArgsOs
fn current_dir() -> Result<PathBuf>
fn current_exe() -> Result<PathBuf>
fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError>
fn remove_var<K: AsRef<OsStr>>(k: K)
fn set_current_dir<P: AsRef<Path>>(path: P) -> Result<()>
fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(k: K, v: V)
fn split_paths<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> SplitPaths
fn temp_dir() -> PathBuf
fn var<K: AsRef<OsStr>>(key: K) -> Result<String, VarError>
fn var_os<K: AsRef<OsStr>>(key: K) -> Option<OsString>
fn vars() -> Vars
fn vars_os() -> VarsOs
}
mod std::error {
trait Error: Debug + Display {
fn description(&self) -> &str
fn source(&self) -> Option<&(dyn Error + 'static)>
}
}
mod std::f32 {
const DIGITS: u32
const EPSILON: f32
const INFINITY: f32
const MANTISSA_DIGITS: u32
const MAX: f32
const MAX_10_EXP: i32
const MAX_EXP: i32
const MIN: f32
const MIN_10_EXP: i32
const MIN_EXP: i32
const MIN_POSITIVE: f32
const NAN: f32
const NEG_INFINITY: f32
const RADIX: u32
}
mod std::f64 {
// Primitive Type
fn floor(self) -> f64
fn ceil(self) -> f64
fn round(self) -> f64
fn trunc(self) -> f64
fn fract(self) -> f64
fn abs(self) -> f64
fn signum(self) -> f64
fn copysign(self, sign: f64) -> f64
fn mul_add(self, a: f64, b: f64) -> f64
fn div_euclid(self, rhs: f64) -> f64
fn rem_euclid(self, rhs: f64) -> f64
fn powi(self, n: i32) -> f64
fn powf(self, n: f64) -> f64
fn sqrt(self) -> f64
fn exp(self) -> f64
fn exp2(self) -> f64
fn ln(self) -> f64
fn log(self, base: f64) -> f64
fn log2(self) -> f64
fn log10(self) -> f64
fn cbrt(self) -> f64
fn hypot(self, other: f64) -> f64
fn sin(self) -> f64
fn cos(self) -> f64
fn tan(self) -> f64
fn asin(self) -> f64
fn acos(self) -> f64
fn atan(self) -> f64
fn atan2(self, other: f64) -> f64
fn sin_cos(self) -> (f64, f64)
fn exp_m1(self) -> f64
fn ln_1p(self) -> f64
fn sinh(self) -> f64
fn cosh(self) -> f64
fn tanh(self) -> f64
fn asinh(self) -> f64
fn acosh(self) -> f64
fn atanh(self) -> f64
fn is_nan(self) -> bool
fn is_infinite(self) -> bool
fn is_finite(self) -> bool
fn is_normal(self) -> bool
fn classify(self) -> FpCategory
fn is_sign_positive(self) -> bool
fn is_sign_negative(self) -> bool
fn recip(self) -> f64
fn to_degrees(self) -> f64
fn to_radians(self) -> f64
fn max(self, other: f64) -> f64
fn min(self, other: f64) -> f64
fn to_bits(self) -> u64
fn from_bits(v: u64) -> f64
// Module
const DIGITS: u32
const EPSILON: f64
const INFINITY: f64
const MANTISSA_DIGITS: u32
const MAX: f64
const MAX_10_EXP: i32
const MAX_EXP: i32
const MIN: f64
const MIN_10_EXP: i32
const MIN_EXP: i32
const MIN_POSITIVE: f64
const NAN: f64
const NEG_INFINITY: f64
const RADIX: u32
}
mod std::ffi {
struct CStr {
unsafe fn from_ptr<'a>(ptr: *const c_char) -> &'a CStr
fn from_bytes_with_nul(bytes: &[u8]) -> Result<&CStr, FromBytesWithNulError>
const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr
const fn as_ptr(&self) -> *const c_char
fn to_bytes(&self) -> &[u8]
fn to_bytes_with_nul(&self) -> &[u8]
fn to_str(&self) -> Result<&str, Utf8Error>
fn to_string_lossy(&self) -> Cow<str>
fn into_c_string(self: Box<CStr>) -> CString
}
struct CString {
fn new<T: Into<Vec<u8>>>(t: T) -> Result<CString, NulError>
unsafe fn from_vec_unchecked(v: Vec<u8>) -> CString
unsafe fn from_raw(ptr: *mut c_char) -> CString
fn into_raw(self) -> *mut c_char
fn into_string(self) -> Result<String, IntoStringError>
fn into_bytes(self) -> Vec<u8>
fn into_bytes_with_nul(self) -> Vec<u8>
fn as_bytes(&self) -> &[u8]
fn as_bytes_with_nul(&self) -> &[u8]
fn as_c_str(&self) -> &CStr
fn into_boxed_c_str(self) -> Box<CStr>
// Methods from Deref<Target = CStr>
}
struct FromBytesWithNulError;
struct IntoStringError {
fn into_cstring(self) -> CString
fn utf8_error(&self) -> Utf8Error
}
struct NulError {
fn nul_position(&self) -> usize
fn into_vec(self) -> Vec<u8>
}
struct OsStr {
fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &OsStr
fn to_str(&self) -> Option<&str>
fn to_string_lossy(&self) -> Cow<str>
fn to_os_string(&self) -> OsString
fn is_empty(&self) -> bool
fn len(&self) -> usize
fn into_os_string(self: Box<OsStr>) -> OsString
}
struct OsString {
fn new() -> OsString
fn as_os_str(&self) -> &OsStr
fn into_string(self) -> Result<String, OsString>
fn push<T: AsRef<OsStr>>(&mut self, s: T)
fn with_capacity(capacity: usize) -> OsString
fn clear(&mut self)
fn capacity(&self) -> usize
fn reserve(&mut self, additional: usize)
fn reserve_exact(&mut self, additional: usize)
fn shrink_to_fit(&mut self)
fn into_boxed_os_str(self) -> Box<OsStr>
// Methods from Deref<Target = OsStr>
}
enum c_void;
}
mod std::fmt {
struct Arguments<'a>;
struct DebugList<'a, 'b> {
fn entry(&mut self, entry: &dyn Debug) -> &mut DebugList<'a, 'b>
fn entries<D, I>(&mut self, entries: I) -> &mut DebugList<'a, 'b>
fn finish(&mut self) -> Result<(), Error>
}
struct DebugMap<'a, 'b> {
fn entry(&mut self, key: &dyn Debug, value: &dyn Debug) -> &mut DebugMap<'a, 'b>
fn entries<K, V, I>(&mut self, entries: I) -> &mut DebugMap<'a, 'b>
fn finish(&mut self) -> Result<(), Error>
}
struct DebugSet<'a, 'b> {
fn entry(&mut self, entry: &dyn Debug) -> &mut DebugSet<'a, 'b>
fn entries<D, I>(&mut self, entries: I) -> &mut DebugSet<'a, 'b>
fn finish(&mut self) -> Result<(), Error>
}
struct DebugStruct<'a, 'b> {
fn field(&mut self, name: &str, value: &dyn Debug) -> &mut DebugStruct<'a, 'b>
fn finish(&mut self) -> Result<(), Error>
}
struct DebugTuple<'a, 'b> {
fn field(&mut self, value: &dyn Debug) -> &mut DebugTuple<'a, 'b>
fn finish(&mut self) -> Result<(), Error>
}
struct Error;
struct Formatter<'a> {
fn pad_integral(&mut self, is_nonnegative: bool, prefix: &str, buf: &str) -> Result<(), Error>
fn pad(&mut self, s: &str) -> Result<(), Error>
fn write_str(&mut self, data: &str) -> Result<(), Error>
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
fn fill(&self) -> char
fn align(&self) -> Option<Alignment>
fn width(&self) -> Option<usize>
fn precision(&self) -> Option<usize>
fn sign_plus(&self) -> bool
fn sign_minus(&self) -> bool
fn alternate(&self) -> bool
fn sign_aware_zero_pad(&self) -> bool
fn debug_struct(&'b mut self, name: &str) -> DebugStruct<'b, 'a>
fn debug_tuple(&'b mut self, name: &str) -> DebugTuple<'b, 'a>
fn debug_list(&'b mut self) -> DebugList<'b, 'a>
fn debug_set(&'b mut self) -> DebugSet<'b, 'a>
fn debug_map(&'b mut self) -> DebugMap<'b, 'a>
}
enum Alignment {
Left,
Right,
Center,
}
trait Binary {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>;
}
trait Debug {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
}
trait Display {
fmt(&self, f: &mut Formatter) -> Result<(), Error>
}
trait LowerExp {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>;
}
trait LowerHex {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>;
}
trait Octal {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
}
trait Pointer {
fmt(&self, f: &mut Formatter) -> Result<(), Error>
}
trait UpperExp {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
}
trait UpperHex {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
}
trait Write {
fn write_str(&mut self, s: &str) -> Result<(), Error>
fn write_char(&mut self, c: char) -> Result<(), Error>
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>
}
fn format(args: Arguments) -> String
fn write(output: &mut dyn Write, args: Arguments) -> Result<(), Error>
type Result = Result<(), Error>;
}
mod std::fs {
struct DirBuilder {
fn new() -> DirBuilder
fn recursive(&mut self, recursive: bool) -> &mut Self
fn create<P: AsRef<Path>>(&self, path: P) -> Result<()>
}
struct DirEntry {
fn path(&self) -> PathBuf
fn metadata(&self) -> Result<Metadata>
fn file_type(&self) -> Result<FileType>
fn file_name(&self) -> OsString
}
struct File {
fn open<P: AsRef<Path>>(path: P) -> Result<File>
fn create<P: AsRef<Path>>(path: P) -> Result<File>
fn sync_all(&self) -> Result<()>
fn sync_data(&self) -> Result<()>
fn set_len(&self, size: u64) -> Result<()>
fn metadata(&self) -> Result<Metadata>
fn try_clone(&self) -> Result<File>
fn set_permissions(&self, perm: Permissions) -> Result<()>
}
struct FileType {
fn is_dir(&self) -> bool
fn is_file(&self) -> bool
fn is_symlink(&self) -> bool
}
struct Metadata {
fn file_type(&self) -> FileType
fn is_dir(&self) -> bool
fn is_file(&self) -> bool
fn len(&self) -> u64
fn permissions(&self) -> Permissions
fn modified(&self) -> Result<SystemTime>
fn accessed(&self) -> Result<SystemTime>
fn created(&self) -> Result<SystemTime>
}
struct OpenOptions {
fn new() -> OpenOptions
fn read(&mut self, read: bool) -> &mut OpenOptions
fn write(&mut self, write: bool) -> &mut OpenOptions
fn append(&mut self, append: bool) -> &mut OpenOptions
fn truncate(&mut self, truncate: bool) -> &mut OpenOptions
fn create(&mut self, create: bool) -> &mut OpenOptions
fn create_new(&mut self, create_new: bool) -> &mut OpenOptions
fn open<P: AsRef<Path>>(&self, path: P) -> Result<File>
}
struct Permissions {
fn readonly(&self) -> bool
fn set_readonly(&mut self, readonly: bool)
}
struct ReadDir;
fn canonicalize<P: AsRef<Path>>(path: P) -> Result<PathBuf>
fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> Result<u64>
fn create_dir<P: AsRef<Path>>(path: P) -> Result<()>
fn create_dir_all<P: AsRef<Path>>(path: P) -> Result<()>
fn hard_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> Result<()>
fn metadata<P: AsRef<Path>>(path: P) -> Result<Metadata>
fn read<P: AsRef<Path>>(path: P) -> Result<Vec<u8>>
fn read_dir<P: AsRef<Path>>(path: P) -> Result<ReadDir>
fn read_link<P: AsRef<Path>>(path: P) -> Result<PathBuf>
fn read_to_string<P: AsRef<Path>>(path: P) -> Result<String>
fn remove_dir<P: AsRef<Path>>(path: P) -> Result<()>
fn remove_dir_all<P: AsRef<Path>>(path: P) -> Result<()>
fn remove_file<P: AsRef<Path>>(path: P) -> Result<()>
fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> Result<()>
fn set_permissions<P: AsRef<Path>>(path: P, perm: Permissions) -> Result<()>
fn symlink_metadata<P: AsRef<Path>>(path: P) -> Result<Metadata>
fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()>
}
mod std::future {
trait Future {
type Output;
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output>
}
}
mod std::hash {
struct BuildHasherDefault<H>;
trait BuildHasher {
type Hasher: Hasher;
fn build_hasher(&self) -> Self::Hasher
}
trait Hash {
fn hash<H>(&self, state: &mut H)
fn hash_slice<H>(data: &[Self], state: &mut H)
}
trait Hasher {
fn finish(&self) -> u64
fn write(&mut self, bytes: &[u8])
fn write_u8(&mut self, i: u8)
fn write_u16(&mut self, i: u16)
fn write_u32(&mut self, i: u32)
fn write_u64(&mut self, i: u64)
fn write_u128(&mut self, i: u128)
fn write_usize(&mut self, i: usize)
fn write_i8(&mut self, i: i8)
fn write_i16(&mut self, i: i16)
fn write_i32(&mut self, i: i32)
fn write_i64(&mut self, i: i64)
fn write_i128(&mut self, i: i128)
fn write_isize(&mut self, i: isize)
}
}
mod std::hint {
unsafe fn unreachable_unchecked() -> !
}
mod std::i8 {
const MAX: i8
const MIN: i8
}
mod std::i16 {
const MAX: i16
const MIN: i16
}
mod std::i32 {
const MAX: i32
const MIN: i32
}
mod std::i64 {
const MAX: i64
const MIN: i64
}
mod std::i128 {
// Primitive Type
const fn min_value() -> i128
const fn max_value() -> i128
fn from_str_radix(src: &str, radix: u32) -> Result<i128, ParseIntError>