Coverage Report

Created: 2025-10-13 07:02

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/fallible_collections-0.5.1/src/vec.rs
Line
Count
Source
1
//! Implement Fallible Vec
2
use super::TryClone;
3
use crate::TryReserveError;
4
#[allow(unused_imports)]
5
use alloc::alloc::{alloc, realloc, Layout};
6
use alloc::vec::Vec;
7
use core::convert::TryInto as _;
8
9
#[cfg(feature = "unstable")]
10
#[macro_export]
11
/// macro trying to create a vec, return a
12
/// Result<Vec<T>,TryReserveError>
13
macro_rules! try_vec {
14
   ($elem:expr; $n:expr) => (
15
        $crate::vec::try_from_elem($elem, $n)
16
    );
17
    ($($x:expr),*) => (
18
        match <alloc::boxed::Box<_> as $crate::boxed::FallibleBox<_>>::try_new([$($x),*]) {
19
            Err(e) => Err(e),
20
            Ok(b) => Ok(<[_]>::into_vec(b)),
21
        }
22
    );
23
    ($($x:expr,)*) => ($crate::try_vec![$($x),*])
24
}
25
26
/// trait implementing all fallible methods on vec
27
pub trait FallibleVec<T> {
28
    /// see reserve
29
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>;
30
    /// see push
31
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError>;
32
    /// try push and give back ownership in case of error
33
    fn try_push_give_back(&mut self, elem: T) -> Result<(), (T, TryReserveError)>;
34
    /// see with capacity, (Self must be sized by the constraint of Result)
35
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
36
    where
37
        Self: core::marker::Sized;
38
    /// see insert
39
    fn try_insert(&mut self, index: usize, element: T) -> Result<(), (T, TryReserveError)>;
40
    /// see append
41
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError>;
42
    /// see resize, only works when the `value` implements Copy, otherwise, look at try_resize_no_copy
43
    fn try_resize(&mut self, new_len: usize, value: T) -> Result<(), TryReserveError>
44
    where
45
        T: Copy + Clone;
46
    fn try_resize_with<F>(&mut self, new_len: usize, f: F) -> Result<(), TryReserveError>
47
    where
48
        F: FnMut() -> T;
49
    /// resize the vec by trying to clone the value repeatingly
50
    fn try_resize_no_copy(&mut self, new_len: usize, value: T) -> Result<(), TryReserveError>
51
    where
52
        T: TryClone;
53
    /// see resize, only works when the `value` implements Copy, otherwise, look at try_extend_from_slice_no_copy
54
    fn try_extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError>
55
    where
56
        T: Copy + Clone;
57
    /// extend the vec by trying to clone the value in `other`
58
    fn try_extend_from_slice_no_copy(&mut self, other: &[T]) -> Result<(), TryReserveError>
59
    where
60
        T: TryClone;
61
}
62
63
/// TryVec is a thin wrapper around alloc::vec::Vec to provide support for
64
/// fallible allocation.
65
///
66
/// See the crate documentation for more.
67
#[derive(PartialEq)]
68
pub struct TryVec<T> {
69
    inner: Vec<T>,
70
}
71
72
impl<T> Default for TryVec<T> {
73
    #[inline(always)]
74
29.2k
    fn default() -> Self {
75
29.2k
        Self {
76
29.2k
            inner: Default::default(),
77
29.2k
        }
78
29.2k
    }
<fallible_collections::vec::TryVec<u8> as core::default::Default>::default
Line
Count
Source
74
26.0k
    fn default() -> Self {
75
26.0k
        Self {
76
26.0k
            inner: Default::default(),
77
26.0k
        }
78
26.0k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::default::Default>::default
Line
Count
Source
74
47
    fn default() -> Self {
75
47
        Self {
76
47
            inner: Default::default(),
77
47
        }
78
47
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::default::Default>::default
Line
Count
Source
74
1.48k
    fn default() -> Self {
75
1.48k
        Self {
76
1.48k
            inner: Default::default(),
77
1.48k
        }
78
1.48k
    }
<fallible_collections::vec::TryVec<mp4parse::Track> as core::default::Default>::default
Line
Count
Source
74
1.48k
    fn default() -> Self {
75
1.48k
        Self {
76
1.48k
            inner: Default::default(),
77
1.48k
        }
78
1.48k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::default::Default>::default
Line
Count
Source
74
47
    fn default() -> Self {
75
47
        Self {
76
47
            inner: Default::default(),
77
47
        }
78
47
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox> as core::default::Default>::default
Line
Count
Source
74
26
    fn default() -> Self {
75
26
        Self {
76
26
            inner: Default::default(),
77
26
        }
78
26
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry> as core::default::Default>::default
Line
Count
Source
74
21
    fn default() -> Self {
75
21
        Self {
76
21
            inner: Default::default(),
77
21
        }
78
21
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox> as core::default::Default>::default
Line
Count
Source
74
38
    fn default() -> Self {
75
38
        Self {
76
38
            inner: Default::default(),
77
38
        }
78
38
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::default::Default>::default
79
}
80
81
impl<T: core::fmt::Debug> core::fmt::Debug for TryVec<T> {
82
    #[inline]
83
0
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
84
0
        self.inner.fmt(f)
85
0
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::TimeOffset> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::Association> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::SampleToChunk> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::Edit> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::Track> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::ItemId> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::Sample> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::DataBox> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::boxes::FourCC> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<u32> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<u64> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<u8> as core::fmt::Debug>::fmt
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::fmt::Debug>::fmt
86
}
87
88
impl<T> TryVec<T> {
89
    #[inline(always)]
90
935k
    pub fn new() -> Self {
91
935k
        Self { inner: Vec::new() }
92
935k
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
789k
    pub fn new() -> Self {
91
789k
        Self { inner: Vec::new() }
92
789k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::new
Line
Count
Source
90
71.4k
    pub fn new() -> Self {
91
71.4k
        Self { inner: Vec::new() }
92
71.4k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::new
Line
Count
Source
90
40
    pub fn new() -> Self {
91
40
        Self { inner: Vec::new() }
92
40
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::new
Line
Count
Source
90
42.2k
    pub fn new() -> Self {
91
42.2k
        Self { inner: Vec::new() }
92
42.2k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::new
Line
Count
Source
90
3
    pub fn new() -> Self {
91
3
        Self { inner: Vec::new() }
92
3
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::new
Line
Count
Source
90
19
    pub fn new() -> Self {
91
19
        Self { inner: Vec::new() }
92
19
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::new
Line
Count
Source
90
19
    pub fn new() -> Self {
91
19
        Self { inner: Vec::new() }
92
19
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::new
Line
Count
Source
90
483
    pub fn new() -> Self {
91
483
        Self { inner: Vec::new() }
92
483
    }
<fallible_collections::vec::TryVec<u32>>::new
Line
Count
Source
90
31.6k
    pub fn new() -> Self {
91
31.6k
        Self { inner: Vec::new() }
92
31.6k
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
7
    pub fn new() -> Self {
91
7
        Self { inner: Vec::new() }
92
7
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::new
Line
Count
Source
90
115
    pub fn new() -> Self {
91
115
        Self { inner: Vec::new() }
92
115
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::new
93
94
    #[inline]
95
175k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
175k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
175k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::with_capacity
Line
Count
Source
95
1.54k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
1.54k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
1.54k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::with_capacity
Line
Count
Source
95
20
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
20
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
20
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::with_capacity
Line
Count
Source
95
35.5k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
35.5k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
35.5k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::with_capacity
Line
Count
Source
95
20
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
20
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
20
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::with_capacity
Line
Count
Source
95
33.9k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
33.9k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
33.9k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::with_capacity
Line
Count
Source
95
2.39k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
2.39k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
2.39k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::with_capacity
Line
Count
Source
95
19
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
19
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
19
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::with_capacity
Line
Count
Source
95
11.2k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
11.2k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
11.2k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::with_capacity
Line
Count
Source
95
62
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
62
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
62
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::with_capacity
Line
Count
Source
95
22.5k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
22.5k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
22.5k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::with_capacity
Line
Count
Source
95
17.6k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
17.6k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
17.6k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::with_capacity
Line
Count
Source
95
5.92k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
5.92k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
5.92k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::with_capacity
Line
Count
Source
95
6.20k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
6.20k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
6.20k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::with_capacity
Line
Count
Source
95
19
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
19
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
19
    }
<fallible_collections::vec::TryVec<u8>>::with_capacity
Line
Count
Source
95
219
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
219
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
219
    }
<fallible_collections::vec::TryVec<u32>>::with_capacity
Line
Count
Source
95
5.51k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
5.51k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
5.51k
    }
<fallible_collections::vec::TryVec<u64>>::with_capacity
Line
Count
Source
95
32.0k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
32.0k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
32.0k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::with_capacity
Line
Count
Source
95
487
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
487
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
487
    }
<fallible_collections::vec::TryVec<usize>>::with_capacity
Line
Count
Source
95
84
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
84
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
84
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::with_capacity
100
101
    #[inline(always)]
102
4.84k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
4.84k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
4.84k
    }
<fallible_collections::vec::TryVec<u8>>::append
Line
Count
Source
102
4.84k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
4.84k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
4.84k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::append
105
106
    #[inline(always)]
107
440
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
440
        self
109
440
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::as_mut_slice
Line
Count
Source
107
440
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
440
        self
109
440
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_mut_slice
110
111
    #[inline(always)]
112
47.4k
    pub fn as_slice(&self) -> &[T] {
113
47.4k
        self
114
47.4k
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
45.8k
    pub fn as_slice(&self) -> &[T] {
113
45.8k
        self
114
45.8k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::as_slice
Line
Count
Source
112
115
    pub fn as_slice(&self) -> &[T] {
113
115
        self
114
115
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
14
    pub fn as_slice(&self) -> &[T] {
113
14
        self
114
14
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::as_slice
Line
Count
Source
112
73
    pub fn as_slice(&self) -> &[T] {
113
73
        self
114
73
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::as_slice
Line
Count
Source
112
973
    pub fn as_slice(&self) -> &[T] {
113
973
        self
114
973
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::as_slice
Line
Count
Source
112
440
    pub fn as_slice(&self) -> &[T] {
113
440
        self
114
440
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_slice
115
116
    #[inline(always)]
117
332
    pub fn clear(&mut self) {
118
332
        self.inner.clear()
119
332
    }
<fallible_collections::vec::TryVec<u8>>::clear
Line
Count
Source
117
332
    pub fn clear(&mut self) {
118
332
        self.inner.clear()
119
332
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::clear
120
121
    #[cfg(test)]
122
    pub fn into_inner(self) -> Vec<T> {
123
        self.inner
124
    }
125
126
    #[inline(always)]
127
49.5k
    pub fn is_empty(&self) -> bool {
128
49.5k
        self.inner.is_empty()
129
49.5k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::is_empty
Line
Count
Source
127
23.8k
    pub fn is_empty(&self) -> bool {
128
23.8k
        self.inner.is_empty()
129
23.8k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::is_empty
Line
Count
Source
127
675
    pub fn is_empty(&self) -> bool {
128
675
        self.inner.is_empty()
129
675
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::is_empty
Line
Count
Source
127
116
    pub fn is_empty(&self) -> bool {
128
116
        self.inner.is_empty()
129
116
    }
<fallible_collections::vec::TryVec<u64>>::is_empty
Line
Count
Source
127
223
    pub fn is_empty(&self) -> bool {
128
223
        self.inner.is_empty()
129
223
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::is_empty
Line
Count
Source
127
9
    pub fn is_empty(&self) -> bool {
128
9
        self.inner.is_empty()
129
9
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::is_empty
Line
Count
Source
127
11.2k
    pub fn is_empty(&self) -> bool {
128
11.2k
        self.inner.is_empty()
129
11.2k
    }
<fallible_collections::vec::TryVec<u8>>::is_empty
Line
Count
Source
127
12.9k
    pub fn is_empty(&self) -> bool {
128
12.9k
        self.inner.is_empty()
129
12.9k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::is_empty
Line
Count
Source
127
440
    pub fn is_empty(&self) -> bool {
128
440
        self.inner.is_empty()
129
440
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::is_empty
130
131
    #[inline(always)]
132
0
    pub fn iter_mut(&mut self) -> IterMut<T> {
133
0
        IterMut {
134
0
            inner: self.inner.iter_mut(),
135
0
        }
136
0
    }
137
138
    #[inline(always)]
139
102k
    pub fn iter(&self) -> Iter<T> {
140
102k
        Iter {
141
102k
            inner: self.inner.iter(),
142
102k
        }
143
102k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::iter
Line
Count
Source
139
23.6k
    pub fn iter(&self) -> Iter<T> {
140
23.6k
        Iter {
141
23.6k
            inner: self.inner.iter(),
142
23.6k
        }
143
23.6k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::iter
Line
Count
Source
139
22.3k
    pub fn iter(&self) -> Iter<T> {
140
22.3k
        Iter {
141
22.3k
            inner: self.inner.iter(),
142
22.3k
        }
143
22.3k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::iter
Line
Count
Source
139
56.1k
    pub fn iter(&self) -> Iter<T> {
140
56.1k
        Iter {
141
56.1k
            inner: self.inner.iter(),
142
56.1k
        }
143
56.1k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::iter
Line
Count
Source
139
13
    pub fn iter(&self) -> Iter<T> {
140
13
        Iter {
141
13
            inner: self.inner.iter(),
142
13
        }
143
13
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::iter
Line
Count
Source
139
17
    pub fn iter(&self) -> Iter<T> {
140
17
        Iter {
141
17
            inner: self.inner.iter(),
142
17
        }
143
17
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::iter
Line
Count
Source
139
20
    pub fn iter(&self) -> Iter<T> {
140
20
        Iter {
141
20
            inner: self.inner.iter(),
142
20
        }
143
20
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::iter
Line
Count
Source
139
20
    pub fn iter(&self) -> Iter<T> {
140
20
        Iter {
141
20
            inner: self.inner.iter(),
142
20
        }
143
20
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::iter
Line
Count
Source
139
24
    pub fn iter(&self) -> Iter<T> {
140
24
        Iter {
141
24
            inner: self.inner.iter(),
142
24
        }
143
24
    }
<fallible_collections::vec::TryVec<u8>>::iter
Line
Count
Source
139
137
    pub fn iter(&self) -> Iter<T> {
140
137
        Iter {
141
137
            inner: self.inner.iter(),
142
137
        }
143
137
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::iter
Line
Count
Source
139
70
    pub fn iter(&self) -> Iter<T> {
140
70
        Iter {
141
70
            inner: self.inner.iter(),
142
70
        }
143
70
    }
<fallible_collections::vec::TryVec<u32>>::iter
Line
Count
Source
139
487
    pub fn iter(&self) -> Iter<T> {
140
487
        Iter {
141
487
            inner: self.inner.iter(),
142
487
        }
143
487
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::iter
144
145
    #[inline(always)]
146
45.4k
    pub fn pop(&mut self) -> Option<T> {
147
45.4k
        self.inner.pop()
148
45.4k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::pop
Line
Count
Source
146
45.4k
    pub fn pop(&mut self) -> Option<T> {
147
45.4k
        self.inner.pop()
148
45.4k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::pop
149
150
    #[inline(always)]
151
275M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
275M
        FallibleVec::try_push(&mut self.inner, value)
153
275M
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::push
Line
Count
Source
151
16.0k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
16.0k
        FallibleVec::try_push(&mut self.inner, value)
153
16.0k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::push
Line
Count
Source
151
6.27k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
6.27k
        FallibleVec::try_push(&mut self.inner, value)
153
6.27k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::push
Line
Count
Source
151
194k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
194k
        FallibleVec::try_push(&mut self.inner, value)
153
194k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::push
Line
Count
Source
151
389k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
389k
        FallibleVec::try_push(&mut self.inner, value)
153
389k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::push
Line
Count
Source
151
86
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
86
        FallibleVec::try_push(&mut self.inner, value)
153
86
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::push
Line
Count
Source
151
132k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
132k
        FallibleVec::try_push(&mut self.inner, value)
153
132k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::push
Line
Count
Source
151
20
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
20
        FallibleVec::try_push(&mut self.inner, value)
153
20
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::push
Line
Count
Source
151
64.0k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
64.0k
        FallibleVec::try_push(&mut self.inner, value)
153
64.0k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::push
Line
Count
Source
151
442k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
442k
        FallibleVec::try_push(&mut self.inner, value)
153
442k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::push
Line
Count
Source
151
2.12k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
2.12k
        FallibleVec::try_push(&mut self.inner, value)
153
2.12k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::push
Line
Count
Source
151
10.5k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
10.5k
        FallibleVec::try_push(&mut self.inner, value)
153
10.5k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::push
Line
Count
Source
151
21.8k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
21.8k
        FallibleVec::try_push(&mut self.inner, value)
153
21.8k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::push
Line
Count
Source
151
40
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
40
        FallibleVec::try_push(&mut self.inner, value)
153
40
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::push
Line
Count
Source
151
4.84k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
4.84k
        FallibleVec::try_push(&mut self.inner, value)
153
4.84k
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::push
Line
Count
Source
151
204k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
204k
        FallibleVec::try_push(&mut self.inner, value)
153
204k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::push
Line
Count
Source
151
53.0k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
53.0k
        FallibleVec::try_push(&mut self.inner, value)
153
53.0k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::push
Line
Count
Source
151
1.01M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
1.01M
        FallibleVec::try_push(&mut self.inner, value)
153
1.01M
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::push
Line
Count
Source
151
8
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
8
        FallibleVec::try_push(&mut self.inner, value)
153
8
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::push
Line
Count
Source
151
40.8k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
40.8k
        FallibleVec::try_push(&mut self.inner, value)
153
40.8k
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::push
Line
Count
Source
151
37.6k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
37.6k
        FallibleVec::try_push(&mut self.inner, value)
153
37.6k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::push
Line
Count
Source
151
280k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
280k
        FallibleVec::try_push(&mut self.inner, value)
153
280k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::push
Line
Count
Source
151
19
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
19
        FallibleVec::try_push(&mut self.inner, value)
153
19
    }
<fallible_collections::vec::TryVec<u32>>::push
Line
Count
Source
151
230k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
230k
        FallibleVec::try_push(&mut self.inner, value)
153
230k
    }
<fallible_collections::vec::TryVec<u64>>::push
Line
Count
Source
151
391k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
391k
        FallibleVec::try_push(&mut self.inner, value)
153
391k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::push
Line
Count
Source
151
70
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
70
        FallibleVec::try_push(&mut self.inner, value)
153
70
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::push
Line
Count
Source
151
136M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
136M
        FallibleVec::try_push(&mut self.inner, value)
153
136M
    }
<fallible_collections::vec::TryVec<usize>>::push
Line
Count
Source
151
135M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
135M
        FallibleVec::try_push(&mut self.inner, value)
153
135M
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::push
154
155
    #[inline(always)]
156
791k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
791k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
791k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::reserve
Line
Count
Source
156
2.39k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
2.39k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
2.39k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::reserve
Line
Count
Source
156
3
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
3
        FallibleVec::try_reserve(&mut self.inner, additional)
158
3
    }
<fallible_collections::vec::TryVec<u32>>::reserve
Line
Count
Source
156
20.1k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
20.1k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
20.1k
    }
<fallible_collections::vec::TryVec<u8>>::reserve
Line
Count
Source
156
768k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
768k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
768k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::reserve
159
160
    #[inline(always)]
161
0
    pub fn resize_with<F>(&mut self, new_len: usize, f: F) -> Result<(), TryReserveError>
162
0
    where
163
0
        F: FnMut() -> T,
164
    {
165
0
        FallibleVec::try_resize_with(&mut self.inner, new_len, f)
166
0
    }
167
}
168
169
impl<T: TryClone> TryClone for TryVec<T> {
170
    #[inline]
171
0
    fn try_clone(&self) -> Result<Self, TryReserveError> {
172
0
        self.as_slice().try_into()
173
0
    }
174
}
175
176
impl<T: TryClone> TryVec<TryVec<T>> {
177
0
    pub fn concat(&self) -> Result<TryVec<T>, TryReserveError> {
178
0
        let size = self.iter().map(|v| v.inner.len()).sum();
179
0
        let mut result = TryVec::with_capacity(size)?;
180
0
        for v in self.iter() {
181
0
            result.inner.try_extend_from_slice_no_copy(&v.inner)?;
182
        }
183
0
        Ok(result)
184
0
    }
185
}
186
187
impl<T: TryClone> TryVec<T> {
188
    #[inline(always)]
189
131k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
131k
        self.inner.try_extend_from_slice_no_copy(other)
191
131k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
5.84k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
5.84k
        self.inner.try_extend_from_slice_no_copy(other)
191
5.84k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
12.9k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
12.9k
        self.inner.try_extend_from_slice_no_copy(other)
191
12.9k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
112k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
112k
        self.inner.try_extend_from_slice_no_copy(other)
191
112k
    }
192
}
193
194
impl<T> IntoIterator for TryVec<T> {
195
    type Item = T;
196
    type IntoIter = alloc::vec::IntoIter<T>;
197
198
    #[inline(always)]
199
36
    fn into_iter(self) -> Self::IntoIter {
200
36
        self.inner.into_iter()
201
36
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
199
19
    fn into_iter(self) -> Self::IntoIter {
200
19
        self.inner.into_iter()
201
19
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
199
17
    fn into_iter(self) -> Self::IntoIter {
200
17
        self.inner.into_iter()
201
17
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::iter::traits::collect::IntoIterator>::into_iter
202
}
203
204
impl<'a, T> IntoIterator for &'a TryVec<T> {
205
    type Item = &'a T;
206
    type IntoIter = alloc::slice::Iter<'a, T>;
207
208
    #[inline(always)]
209
684
    fn into_iter(self) -> Self::IntoIter {
210
684
        self.inner.iter()
211
684
    }
<&fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
6
    fn into_iter(self) -> Self::IntoIter {
210
6
        self.inner.iter()
211
6
    }
<&fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
332
    fn into_iter(self) -> Self::IntoIter {
210
332
        self.inner.iter()
211
332
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
20
    fn into_iter(self) -> Self::IntoIter {
210
20
        self.inner.iter()
211
20
    }
<&fallible_collections::vec::TryVec<mp4parse::DataBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
8
    fn into_iter(self) -> Self::IntoIter {
210
8
        self.inner.iter()
211
8
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
125
    fn into_iter(self) -> Self::IntoIter {
210
125
        self.inner.iter()
211
125
    }
<&fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
115
    fn into_iter(self) -> Self::IntoIter {
210
115
        self.inner.iter()
211
115
    }
<&fallible_collections::vec::TryVec<u32> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
78
    fn into_iter(self) -> Self::IntoIter {
210
78
        self.inner.iter()
211
78
    }
Unexecuted instantiation: <&fallible_collections::vec::TryVec<_> as core::iter::traits::collect::IntoIterator>::into_iter
212
}
213
214
#[cfg(feature = "std_io")]
215
pub mod std_io {
216
    use super::*;
217
    use std::io::{self, Read, Take, Write};
218
219
    pub trait TryRead {
220
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize>;
221
222
        #[inline]
223
768k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
768k
            let mut buf = TryVec::new();
225
768k
            self.try_read_to_end(&mut buf)?;
226
767k
            Ok(buf)
227
768k
        }
<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
1.31k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.31k
            let mut buf = TryVec::new();
225
1.31k
            self.try_read_to_end(&mut buf)?;
226
1.31k
            Ok(buf)
227
1.31k
        }
<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
3.28k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
3.28k
            let mut buf = TryVec::new();
225
3.28k
            self.try_read_to_end(&mut buf)?;
226
3.28k
            Ok(buf)
227
3.28k
        }
<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
4.40k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.40k
            let mut buf = TryVec::new();
225
4.40k
            self.try_read_to_end(&mut buf)?;
226
4.40k
            Ok(buf)
227
4.40k
        }
<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
35.7k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
35.7k
            let mut buf = TryVec::new();
225
35.7k
            self.try_read_to_end(&mut buf)?;
226
35.7k
            Ok(buf)
227
35.7k
        }
<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
170
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
170
            let mut buf = TryVec::new();
225
170
            self.try_read_to_end(&mut buf)?;
226
170
            Ok(buf)
227
170
        }
<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
37.5k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
37.5k
            let mut buf = TryVec::new();
225
37.5k
            self.try_read_to_end(&mut buf)?;
226
37.5k
            Ok(buf)
227
37.5k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
32
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
32
            let mut buf = TryVec::new();
225
32
            self.try_read_to_end(&mut buf)?;
226
32
            Ok(buf)
227
32
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
6.21k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
6.21k
            let mut buf = TryVec::new();
225
6.21k
            self.try_read_to_end(&mut buf)?;
226
6.21k
            Ok(buf)
227
6.21k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
17.2k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
17.2k
            let mut buf = TryVec::new();
225
17.2k
            self.try_read_to_end(&mut buf)?;
226
17.2k
            Ok(buf)
227
17.2k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
34.1k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
34.1k
            let mut buf = TryVec::new();
225
34.1k
            self.try_read_to_end(&mut buf)?;
226
33.7k
            Ok(buf)
227
34.1k
        }
Unexecuted instantiation: <std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
9.80k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
9.80k
            let mut buf = TryVec::new();
225
9.80k
            self.try_read_to_end(&mut buf)?;
226
9.80k
            Ok(buf)
227
9.80k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
1.52k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.52k
            let mut buf = TryVec::new();
225
1.52k
            self.try_read_to_end(&mut buf)?;
226
1.52k
            Ok(buf)
227
1.52k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
6.86k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
6.86k
            let mut buf = TryVec::new();
225
6.86k
            self.try_read_to_end(&mut buf)?;
226
6.86k
            Ok(buf)
227
6.86k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
90.6k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
90.6k
            let mut buf = TryVec::new();
225
90.6k
            self.try_read_to_end(&mut buf)?;
226
90.6k
            Ok(buf)
227
90.6k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
356k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
356k
            let mut buf = TryVec::new();
225
356k
            self.try_read_to_end(&mut buf)?;
226
356k
            Ok(buf)
227
356k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
86
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
86
            let mut buf = TryVec::new();
225
86
            self.try_read_to_end(&mut buf)?;
226
86
            Ok(buf)
227
86
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
1.41k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.41k
            let mut buf = TryVec::new();
225
1.41k
            self.try_read_to_end(&mut buf)?;
226
1.41k
            Ok(buf)
227
1.41k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
3.51k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
3.51k
            let mut buf = TryVec::new();
225
3.51k
            self.try_read_to_end(&mut buf)?;
226
3.51k
            Ok(buf)
227
3.51k
        }
<std::io::Take<&mut std::io::cursor::Cursor<&fallible_collections::vec::TryVec<u8>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
158k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
158k
            let mut buf = TryVec::new();
225
158k
            self.try_read_to_end(&mut buf)?;
226
158k
            Ok(buf)
227
158k
        }
Unexecuted instantiation: <_ as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
228
    }
229
230
    impl<T: Read> TryRead for Take<T> {
231
        /// This function reserves the upper limit of what `src` can generate before
232
        /// reading all bytes until EOF in this source, placing them into `buf`. If the
233
        /// allocation is unsuccessful, or reading from the source generates an error
234
        /// before reaching EOF, this will return an error. Otherwise, it will return
235
        /// the number of bytes read.
236
        ///
237
        /// Since `Take::limit()` may return a value greater than the number of bytes
238
        /// which can be read from the source, it's possible this function may fail
239
        /// in the allocation phase even though allocating the number of bytes available
240
        /// to read would have succeeded. In general, it is assumed that the callers
241
        /// have accurate knowledge of the number of bytes of interest and have created
242
        /// `src` accordingly.
243
        #[inline]
244
685k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
685k
            try_read_up_to(self, self.limit(), buf)
246
685k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
32
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
32
            try_read_up_to(self, self.limit(), buf)
246
32
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
6.21k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
6.21k
            try_read_up_to(self, self.limit(), buf)
246
6.21k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
17.2k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
17.2k
            try_read_up_to(self, self.limit(), buf)
246
17.2k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
34.1k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
34.1k
            try_read_up_to(self, self.limit(), buf)
246
34.1k
        }
Unexecuted instantiation: <std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
9.80k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
9.80k
            try_read_up_to(self, self.limit(), buf)
246
9.80k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
1.52k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.52k
            try_read_up_to(self, self.limit(), buf)
246
1.52k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
6.86k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
6.86k
            try_read_up_to(self, self.limit(), buf)
246
6.86k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
90.6k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
90.6k
            try_read_up_to(self, self.limit(), buf)
246
90.6k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
356k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
356k
            try_read_up_to(self, self.limit(), buf)
246
356k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
86
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
86
            try_read_up_to(self, self.limit(), buf)
246
86
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
1.41k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.41k
            try_read_up_to(self, self.limit(), buf)
246
1.41k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
3.51k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
3.51k
            try_read_up_to(self, self.limit(), buf)
246
3.51k
        }
<std::io::Take<&mut std::io::cursor::Cursor<&fallible_collections::vec::TryVec<u8>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
158k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
158k
            try_read_up_to(self, self.limit(), buf)
246
158k
        }
Unexecuted instantiation: <std::io::Take<_> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
247
    }
248
249
    /// Read up to `limit` bytes from `src`, placing them into `buf` and returning the
250
    /// number of bytes read. Space for `limit` additional bytes is reserved in `buf`, so
251
    /// this function will return an error if the allocation fails.
252
768k
    pub fn try_read_up_to<R: Read>(
253
768k
        src: &mut R,
254
768k
        limit: u64,
255
768k
        buf: &mut TryVec<u8>,
256
768k
    ) -> io::Result<usize> {
257
768k
        let additional = limit
258
768k
            .try_into()
259
768k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::cursor::Cursor<&fallible_collections::vec::TryVec<u8>>>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<&mut mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>::{closure#0}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<_>::{closure#0}
260
768k
        buf.reserve(additional)
261
768k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>::{closure#1}
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>::{closure#1}
Line
Count
Source
261
42
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>::{closure#1}
Line
Count
Source
261
335
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::cursor::Cursor<&fallible_collections::vec::TryVec<u8>>>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<&mut mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>::{closure#1}
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<_>::{closure#1}
262
768k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
768k
        Ok(bytes_read)
264
768k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>
Line
Count
Source
252
1.31k
    pub fn try_read_up_to<R: Read>(
253
1.31k
        src: &mut R,
254
1.31k
        limit: u64,
255
1.31k
        buf: &mut TryVec<u8>,
256
1.31k
    ) -> io::Result<usize> {
257
1.31k
        let additional = limit
258
1.31k
            .try_into()
259
1.31k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.31k
        buf.reserve(additional)
261
1.31k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.31k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.31k
        Ok(bytes_read)
264
1.31k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>
Line
Count
Source
252
3.28k
    pub fn try_read_up_to<R: Read>(
253
3.28k
        src: &mut R,
254
3.28k
        limit: u64,
255
3.28k
        buf: &mut TryVec<u8>,
256
3.28k
    ) -> io::Result<usize> {
257
3.28k
        let additional = limit
258
3.28k
            .try_into()
259
3.28k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
3.28k
        buf.reserve(additional)
261
3.28k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
3.28k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
3.28k
        Ok(bytes_read)
264
3.28k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>
Line
Count
Source
252
4.68k
    pub fn try_read_up_to<R: Read>(
253
4.68k
        src: &mut R,
254
4.68k
        limit: u64,
255
4.68k
        buf: &mut TryVec<u8>,
256
4.68k
    ) -> io::Result<usize> {
257
4.68k
        let additional = limit
258
4.68k
            .try_into()
259
4.68k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.68k
        buf.reserve(additional)
261
4.68k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.68k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.68k
        Ok(bytes_read)
264
4.68k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>
Line
Count
Source
252
35.7k
    pub fn try_read_up_to<R: Read>(
253
35.7k
        src: &mut R,
254
35.7k
        limit: u64,
255
35.7k
        buf: &mut TryVec<u8>,
256
35.7k
    ) -> io::Result<usize> {
257
35.7k
        let additional = limit
258
35.7k
            .try_into()
259
35.7k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
35.7k
        buf.reserve(additional)
261
35.7k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
35.7k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
35.7k
        Ok(bytes_read)
264
35.7k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
170
    pub fn try_read_up_to<R: Read>(
253
170
        src: &mut R,
254
170
        limit: u64,
255
170
        buf: &mut TryVec<u8>,
256
170
    ) -> io::Result<usize> {
257
170
        let additional = limit
258
170
            .try_into()
259
170
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
170
        buf.reserve(additional)
261
170
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
170
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
170
        Ok(bytes_read)
264
170
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>
Line
Count
Source
252
37.5k
    pub fn try_read_up_to<R: Read>(
253
37.5k
        src: &mut R,
254
37.5k
        limit: u64,
255
37.5k
        buf: &mut TryVec<u8>,
256
37.5k
    ) -> io::Result<usize> {
257
37.5k
        let additional = limit
258
37.5k
            .try_into()
259
37.5k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
37.5k
        buf.reserve(additional)
261
37.5k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
37.5k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
37.5k
        Ok(bytes_read)
264
37.5k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>
Line
Count
Source
252
32
    pub fn try_read_up_to<R: Read>(
253
32
        src: &mut R,
254
32
        limit: u64,
255
32
        buf: &mut TryVec<u8>,
256
32
    ) -> io::Result<usize> {
257
32
        let additional = limit
258
32
            .try_into()
259
32
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
32
        buf.reserve(additional)
261
32
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
32
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
32
        Ok(bytes_read)
264
32
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>
Line
Count
Source
252
6.21k
    pub fn try_read_up_to<R: Read>(
253
6.21k
        src: &mut R,
254
6.21k
        limit: u64,
255
6.21k
        buf: &mut TryVec<u8>,
256
6.21k
    ) -> io::Result<usize> {
257
6.21k
        let additional = limit
258
6.21k
            .try_into()
259
6.21k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
6.21k
        buf.reserve(additional)
261
6.21k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
6.21k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
6.21k
        Ok(bytes_read)
264
6.21k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>
Line
Count
Source
252
17.2k
    pub fn try_read_up_to<R: Read>(
253
17.2k
        src: &mut R,
254
17.2k
        limit: u64,
255
17.2k
        buf: &mut TryVec<u8>,
256
17.2k
    ) -> io::Result<usize> {
257
17.2k
        let additional = limit
258
17.2k
            .try_into()
259
17.2k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
17.2k
        buf.reserve(additional)
261
17.2k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
17.2k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
17.2k
        Ok(bytes_read)
264
17.2k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>
Line
Count
Source
252
34.1k
    pub fn try_read_up_to<R: Read>(
253
34.1k
        src: &mut R,
254
34.1k
        limit: u64,
255
34.1k
        buf: &mut TryVec<u8>,
256
34.1k
    ) -> io::Result<usize> {
257
34.1k
        let additional = limit
258
34.1k
            .try_into()
259
34.1k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
34.1k
        buf.reserve(additional)
261
34.1k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
33.7k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
33.7k
        Ok(bytes_read)
264
34.1k
    }
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>>
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>
Line
Count
Source
252
9.80k
    pub fn try_read_up_to<R: Read>(
253
9.80k
        src: &mut R,
254
9.80k
        limit: u64,
255
9.80k
        buf: &mut TryVec<u8>,
256
9.80k
    ) -> io::Result<usize> {
257
9.80k
        let additional = limit
258
9.80k
            .try_into()
259
9.80k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
9.80k
        buf.reserve(additional)
261
9.80k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
9.80k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
9.80k
        Ok(bytes_read)
264
9.80k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>
Line
Count
Source
252
1.52k
    pub fn try_read_up_to<R: Read>(
253
1.52k
        src: &mut R,
254
1.52k
        limit: u64,
255
1.52k
        buf: &mut TryVec<u8>,
256
1.52k
    ) -> io::Result<usize> {
257
1.52k
        let additional = limit
258
1.52k
            .try_into()
259
1.52k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.52k
        buf.reserve(additional)
261
1.52k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.52k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.52k
        Ok(bytes_read)
264
1.52k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>>
Line
Count
Source
252
6.86k
    pub fn try_read_up_to<R: Read>(
253
6.86k
        src: &mut R,
254
6.86k
        limit: u64,
255
6.86k
        buf: &mut TryVec<u8>,
256
6.86k
    ) -> io::Result<usize> {
257
6.86k
        let additional = limit
258
6.86k
            .try_into()
259
6.86k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
6.86k
        buf.reserve(additional)
261
6.86k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
6.86k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
6.86k
        Ok(bytes_read)
264
6.86k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>
Line
Count
Source
252
90.6k
    pub fn try_read_up_to<R: Read>(
253
90.6k
        src: &mut R,
254
90.6k
        limit: u64,
255
90.6k
        buf: &mut TryVec<u8>,
256
90.6k
    ) -> io::Result<usize> {
257
90.6k
        let additional = limit
258
90.6k
            .try_into()
259
90.6k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
90.6k
        buf.reserve(additional)
261
90.6k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
90.6k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
90.6k
        Ok(bytes_read)
264
90.6k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>
Line
Count
Source
252
356k
    pub fn try_read_up_to<R: Read>(
253
356k
        src: &mut R,
254
356k
        limit: u64,
255
356k
        buf: &mut TryVec<u8>,
256
356k
    ) -> io::Result<usize> {
257
356k
        let additional = limit
258
356k
            .try_into()
259
356k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
356k
        buf.reserve(additional)
261
356k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
356k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
356k
        Ok(bytes_read)
264
356k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>
Line
Count
Source
252
86
    pub fn try_read_up_to<R: Read>(
253
86
        src: &mut R,
254
86
        limit: u64,
255
86
        buf: &mut TryVec<u8>,
256
86
    ) -> io::Result<usize> {
257
86
        let additional = limit
258
86
            .try_into()
259
86
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
86
        buf.reserve(additional)
261
86
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
86
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
86
        Ok(bytes_read)
264
86
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>
Line
Count
Source
252
1.41k
    pub fn try_read_up_to<R: Read>(
253
1.41k
        src: &mut R,
254
1.41k
        limit: u64,
255
1.41k
        buf: &mut TryVec<u8>,
256
1.41k
    ) -> io::Result<usize> {
257
1.41k
        let additional = limit
258
1.41k
            .try_into()
259
1.41k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.41k
        buf.reserve(additional)
261
1.41k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.41k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.41k
        Ok(bytes_read)
264
1.41k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
3.51k
    pub fn try_read_up_to<R: Read>(
253
3.51k
        src: &mut R,
254
3.51k
        limit: u64,
255
3.51k
        buf: &mut TryVec<u8>,
256
3.51k
    ) -> io::Result<usize> {
257
3.51k
        let additional = limit
258
3.51k
            .try_into()
259
3.51k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
3.51k
        buf.reserve(additional)
261
3.51k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
3.51k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
3.51k
        Ok(bytes_read)
264
3.51k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::cursor::Cursor<&fallible_collections::vec::TryVec<u8>>>>
Line
Count
Source
252
158k
    pub fn try_read_up_to<R: Read>(
253
158k
        src: &mut R,
254
158k
        limit: u64,
255
158k
        buf: &mut TryVec<u8>,
256
158k
    ) -> io::Result<usize> {
257
158k
        let additional = limit
258
158k
            .try_into()
259
158k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
158k
        buf.reserve(additional)
261
158k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
158k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
158k
        Ok(bytes_read)
264
158k
    }
fallible_collections::vec::std_io::try_read_up_to::<&mut mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>
Line
Count
Source
252
392
    pub fn try_read_up_to<R: Read>(
253
392
        src: &mut R,
254
392
        limit: u64,
255
392
        buf: &mut TryVec<u8>,
256
392
    ) -> io::Result<usize> {
257
392
        let additional = limit
258
392
            .try_into()
259
392
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
392
        buf.reserve(additional)
261
392
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
392
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
392
        Ok(bytes_read)
264
392
    }
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<_>
265
266
    impl Write for TryVec<u8> {
267
112k
        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
268
112k
            self.extend_from_slice(buf)
269
112k
                .map_err(|_| io::Error::new(io::ErrorKind::Other, "extend_from_slice failed"))?;
270
112k
            Ok(buf.len())
271
112k
        }
272
273
        #[inline(always)]
274
0
        fn flush(&mut self) -> io::Result<()> {
275
0
            Ok(())
276
0
        }
277
    }
278
279
    #[cfg(test)]
280
    mod tests {
281
        use super::*;
282
283
        #[test]
284
        fn try_read_to_end() {
285
            let mut src = b"1234567890".take(5);
286
            let mut buf = TryVec::new();
287
            src.try_read_to_end(&mut buf).unwrap();
288
            assert_eq!(buf.len(), 5);
289
            assert_eq!(buf, b"12345".as_ref());
290
        }
291
292
        #[test]
293
        fn read_into_try_vec() {
294
            let mut src = b"1234567890".take(5);
295
            let buf = src.read_into_try_vec().unwrap();
296
            assert_eq!(buf.len(), 5);
297
            assert_eq!(buf, b"12345".as_ref());
298
        }
299
300
        #[test]
301
        fn read_into_try_vec_oom() {
302
            let mut src = b"1234567890".take(core::usize::MAX.try_into().expect("usize < u64"));
303
            assert!(src.read_into_try_vec().is_err());
304
        }
305
306
        #[test]
307
        fn try_read_up_to() {
308
            let src = b"1234567890";
309
            let mut buf = TryVec::new();
310
            super::try_read_up_to(&mut src.as_ref(), 5, &mut buf).unwrap();
311
            assert_eq!(buf.len(), 5);
312
            assert_eq!(buf, b"12345".as_ref());
313
        }
314
315
        #[test]
316
        fn try_read_up_to_oom() {
317
            let src = b"1234567890";
318
            let mut buf = TryVec::new();
319
            let limit = core::usize::MAX.try_into().expect("usize < u64");
320
            let res = super::try_read_up_to(&mut src.as_ref(), limit, &mut buf);
321
            assert!(res.is_err());
322
        }
323
    }
324
}
325
326
impl<T: PartialEq> PartialEq<Vec<T>> for TryVec<T> {
327
    #[inline(always)]
328
0
    fn eq(&self, other: &Vec<T>) -> bool {
329
0
        self.inner.eq(other)
330
0
    }
331
}
332
333
impl<'a, T: PartialEq> PartialEq<&'a [T]> for TryVec<T> {
334
    #[inline(always)]
335
0
    fn eq(&self, other: &&[T]) -> bool {
336
0
        self.inner.eq(other)
337
0
    }
338
}
339
340
impl PartialEq<&str> for TryVec<u8> {
341
    #[inline]
342
0
    fn eq(&self, other: &&str) -> bool {
343
0
        self.as_slice() == other.as_bytes()
344
0
    }
345
}
346
347
impl core::convert::AsRef<[u8]> for TryVec<u8> {
348
    #[inline(always)]
349
182k
    fn as_ref(&self) -> &[u8] {
350
182k
        self.inner.as_ref()
351
182k
    }
352
}
353
354
impl<T> core::convert::From<Vec<T>> for TryVec<T> {
355
    #[inline(always)]
356
0
    fn from(value: Vec<T>) -> Self {
357
0
        Self { inner: value }
358
0
    }
359
}
360
361
impl<T: TryClone> core::convert::TryFrom<&[T]> for TryVec<T> {
362
    type Error = TryReserveError;
363
364
    #[inline]
365
274
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
274
        let mut v = Self::new();
367
274
        v.inner.try_extend_from_slice_no_copy(value)?;
368
274
        Ok(v)
369
274
    }
<fallible_collections::vec::TryVec<u8> as core::convert::TryFrom<&[u8]>>::try_from
Line
Count
Source
365
274
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
274
        let mut v = Self::new();
367
274
        v.inner.try_extend_from_slice_no_copy(value)?;
368
274
        Ok(v)
369
274
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::convert::TryFrom<&[_]>>::try_from
370
}
371
372
impl core::convert::TryFrom<&str> for TryVec<u8> {
373
    type Error = TryReserveError;
374
375
    #[inline]
376
0
    fn try_from(value: &str) -> Result<Self, Self::Error> {
377
0
        let mut v = Self::new();
378
0
        v.extend_from_slice(value.as_bytes())?;
379
0
        Ok(v)
380
0
    }
381
}
382
383
impl<T> core::ops::Deref for TryVec<T> {
384
    type Target = [T];
385
386
    #[inline(always)]
387
971M
    fn deref(&self) -> &[T] {
388
971M
        self.inner.deref()
389
971M
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
191k
    fn deref(&self) -> &[T] {
388
191k
        self.inner.deref()
389
191k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock> as core::ops::deref::Deref>::deref
Line
Count
Source
387
18
    fn deref(&self) -> &[T] {
388
18
        self.inner.deref()
389
18
    }
<fallible_collections::vec::TryVec<mp4parse::Track> as core::ops::deref::Deref>::deref
Line
Count
Source
387
200k
    fn deref(&self) -> &[T] {
388
200k
        self.inner.deref()
389
200k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
48.2k
    fn deref(&self) -> &[T] {
388
48.2k
        self.inner.deref()
389
48.2k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
16.0k
    fn deref(&self) -> &[T] {
388
16.0k
        self.inner.deref()
389
16.0k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
440
    fn deref(&self) -> &[T] {
388
440
        self.inner.deref()
389
440
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
809k
    fn deref(&self) -> &[T] {
388
809k
        self.inner.deref()
389
809k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
20
    fn deref(&self) -> &[T] {
388
20
        self.inner.deref()
389
20
    }
<fallible_collections::vec::TryVec<mp4parse::Edit> as core::ops::deref::Deref>::deref
Line
Count
Source
387
35.7k
    fn deref(&self) -> &[T] {
388
35.7k
        self.inner.deref()
389
35.7k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::ops::deref::Deref>::deref
Line
Count
Source
387
17
    fn deref(&self) -> &[T] {
388
17
        self.inner.deref()
389
17
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::ops::deref::Deref>::deref
Line
Count
Source
387
34
    fn deref(&self) -> &[T] {
388
34
        self.inner.deref()
389
34
    }
<fallible_collections::vec::TryVec<(u8, u32)> as core::ops::deref::Deref>::deref
Line
Count
Source
387
19
    fn deref(&self) -> &[T] {
388
19
        self.inner.deref()
389
19
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC> as core::ops::deref::Deref>::deref
Line
Count
Source
387
1.94k
    fn deref(&self) -> &[T] {
388
1.94k
        self.inner.deref()
389
1.94k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty> as core::ops::deref::Deref>::deref
Line
Count
Source
387
122
    fn deref(&self) -> &[T] {
388
122
        self.inner.deref()
389
122
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
46
    fn deref(&self) -> &[T] {
388
46
        self.inner.deref()
389
46
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset> as core::ops::deref::Deref>::deref
Line
Count
Source
387
73
    fn deref(&self) -> &[T] {
388
73
        self.inner.deref()
389
73
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
969M
    fn deref(&self) -> &[T] {
388
969M
        self.inner.deref()
389
969M
    }
<fallible_collections::vec::TryVec<u32> as core::ops::deref::Deref>::deref
Line
Count
Source
387
54
    fn deref(&self) -> &[T] {
388
54
        self.inner.deref()
389
54
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk> as core::ops::deref::Deref>::deref
Line
Count
Source
387
973
    fn deref(&self) -> &[T] {
388
973
        self.inner.deref()
389
973
    }
<fallible_collections::vec::TryVec<mp4parse::Sample> as core::ops::deref::Deref>::deref
Line
Count
Source
387
440
    fn deref(&self) -> &[T] {
388
440
        self.inner.deref()
389
440
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::Deref>::deref
Line
Count
Source
387
84
    fn deref(&self) -> &[T] {
388
84
        self.inner.deref()
389
84
    }
<fallible_collections::vec::TryVec<u64> as core::ops::deref::Deref>::deref
Line
Count
Source
387
101k
    fn deref(&self) -> &[T] {
388
101k
        self.inner.deref()
389
101k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::ops::deref::Deref>::deref
390
}
391
392
impl<T> core::ops::DerefMut for TryVec<T> {
393
135M
    fn deref_mut(&mut self) -> &mut [T] {
394
135M
        self.inner.deref_mut()
395
135M
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
135M
    fn deref_mut(&mut self) -> &mut [T] {
394
135M
        self.inner.deref_mut()
395
135M
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
84
    fn deref_mut(&mut self) -> &mut [T] {
394
84
        self.inner.deref_mut()
395
84
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::ops::deref::DerefMut>::deref_mut
396
}
397
398
pub struct Iter<'a, T> {
399
    inner: alloc::slice::Iter<'a, T>,
400
}
401
402
impl<'a, T> Iterator for Iter<'a, T> {
403
    type Item = &'a T;
404
405
    #[inline(always)]
406
156M
    fn next(&mut self) -> Option<Self::Item> {
407
156M
        self.inner.next()
408
156M
    }
<fallible_collections::vec::Iter<mp4parse::SampleEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
45.9k
    fn next(&mut self) -> Option<Self::Item> {
407
45.9k
        self.inner.next()
408
45.9k
    }
<fallible_collections::vec::Iter<mp4parse::ItemInfoEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
17
    fn next(&mut self) -> Option<Self::Item> {
407
17
        self.inner.next()
408
17
    }
<fallible_collections::vec::Iter<mp4parse::SampleToChunk> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
13
    fn next(&mut self) -> Option<Self::Item> {
407
13
        self.inner.next()
408
13
    }
<fallible_collections::vec::Iter<mp4parse::ProtectionSchemeInfoBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
23.1k
    fn next(&mut self) -> Option<Self::Item> {
407
23.1k
        self.inner.next()
408
23.1k
    }
<fallible_collections::vec::Iter<mp4parse::SingleItemTypeReferenceBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
42
    fn next(&mut self) -> Option<Self::Item> {
407
42
        self.inner.next()
408
42
    }
<fallible_collections::vec::Iter<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
21
    fn next(&mut self) -> Option<Self::Item> {
407
21
        self.inner.next()
408
21
    }
<fallible_collections::vec::Iter<mp4parse::Track> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
20.4M
    fn next(&mut self) -> Option<Self::Item> {
407
20.4M
        self.inner.next()
408
20.4M
    }
<fallible_collections::vec::Iter<u8> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
4.54k
    fn next(&mut self) -> Option<Self::Item> {
407
4.54k
        self.inner.next()
408
4.54k
    }
<fallible_collections::vec::Iter<mp4parse::DataBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
24
    fn next(&mut self) -> Option<Self::Item> {
407
24
        self.inner.next()
408
24
    }
<fallible_collections::vec::Iter<mp4parse::TrackReferenceEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
124
    fn next(&mut self) -> Option<Self::Item> {
407
124
        self.inner.next()
408
124
    }
<fallible_collections::vec::Iter<u32> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
136M
    fn next(&mut self) -> Option<Self::Item> {
407
136M
        self.inner.next()
408
136M
    }
Unexecuted instantiation: <fallible_collections::vec::Iter<_> as core::iter::traits::iterator::Iterator>::next
409
410
    #[inline(always)]
411
0
    fn size_hint(&self) -> (usize, Option<usize>) {
412
0
        self.inner.size_hint()
413
0
    }
414
}
415
416
pub struct IterMut<'a, T> {
417
    inner: alloc::slice::IterMut<'a, T>,
418
}
419
420
impl<'a, T> Iterator for IterMut<'a, T> {
421
    type Item = &'a mut T;
422
423
    #[inline(always)]
424
0
    fn next(&mut self) -> Option<Self::Item> {
425
0
        self.inner.next()
426
0
    }
427
428
    #[inline(always)]
429
0
    fn size_hint(&self) -> (usize, Option<usize>) {
430
0
        self.inner.size_hint()
431
0
    }
432
}
433
434
131k
fn needs_to_grow<T>(v: &Vec<T>, len: usize) -> bool {
435
131k
    v.len()
436
131k
        .checked_add(len)
437
131k
        .map_or(true, |needed| needed > v.capacity())
438
131k
}
439
440
impl<T> FallibleVec<T> for Vec<T> {
441
    #[inline(always)]
442
971k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
971k
        self.try_reserve(additional)
444
971k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_reserve
Line
Count
Source
442
1.54k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.54k
        self.try_reserve(additional)
444
1.54k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_reserve
Line
Count
Source
442
20
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
20
        self.try_reserve(additional)
444
20
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_reserve
Line
Count
Source
442
35.5k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
35.5k
        self.try_reserve(additional)
444
35.5k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_reserve
Line
Count
Source
442
20
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
20
        self.try_reserve(additional)
444
20
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_reserve
Line
Count
Source
442
33.9k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
33.9k
        self.try_reserve(additional)
444
33.9k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_reserve
Line
Count
Source
442
2.39k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
2.39k
        self.try_reserve(additional)
444
2.39k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_reserve
Line
Count
Source
442
19
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
19
        self.try_reserve(additional)
444
19
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_reserve
Line
Count
Source
442
11.2k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
11.2k
        self.try_reserve(additional)
444
11.2k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_reserve
Line
Count
Source
442
62
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
62
        self.try_reserve(additional)
444
62
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_reserve
Line
Count
Source
442
22.5k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
22.5k
        self.try_reserve(additional)
444
22.5k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_reserve
Line
Count
Source
442
17.6k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
17.6k
        self.try_reserve(additional)
444
17.6k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_reserve
Line
Count
Source
442
5.92k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
5.92k
        self.try_reserve(additional)
444
5.92k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_reserve
Line
Count
Source
442
6.20k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
6.20k
        self.try_reserve(additional)
444
6.20k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_reserve
Line
Count
Source
442
19
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
19
        self.try_reserve(additional)
444
19
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
773k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
773k
        self.try_reserve(additional)
444
773k
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_reserve
Line
Count
Source
442
25.6k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
25.6k
        self.try_reserve(additional)
444
25.6k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_reserve
Line
Count
Source
442
32.0k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
32.0k
        self.try_reserve(additional)
444
32.0k
    }
<alloc::vec::Vec<fallible_collections::vec::TryVec<u8>> as fallible_collections::vec::FallibleVec<fallible_collections::vec::TryVec<u8>>>::try_reserve
Line
Count
Source
442
2.39k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
2.39k
        self.try_reserve(additional)
444
2.39k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_reserve
Line
Count
Source
442
3
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
3
        self.try_reserve(additional)
444
3
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_reserve
Line
Count
Source
442
487
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
487
        self.try_reserve(additional)
444
487
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_reserve
Line
Count
Source
442
84
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
84
        self.try_reserve(additional)
444
84
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
219
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
219
        self.try_reserve(additional)
444
219
    }
445
446
    #[inline]
447
275M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
275M
        if self.len() == self.capacity() {
449
42.7k
            self.try_reserve(1)?;
450
275M
        }
451
275M
        Ok(self.push(elem))
452
275M
    }
<alloc::vec::Vec<fallible_collections::vec::TryVec<u8>> as fallible_collections::vec::FallibleVec<fallible_collections::vec::TryVec<u8>>>::try_push
Line
Count
Source
447
194k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
194k
        if self.len() == self.capacity() {
449
36.3k
            self.try_reserve(1)?;
450
158k
        }
451
194k
        Ok(self.push(elem))
452
194k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_push
Line
Count
Source
447
389k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
389k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
389k
        }
451
389k
        Ok(self.push(elem))
452
389k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_push
Line
Count
Source
447
86
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
86
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
86
        }
451
86
        Ok(self.push(elem))
452
86
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_push
Line
Count
Source
447
132k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
132k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
132k
        }
451
132k
        Ok(self.push(elem))
452
132k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_push
Line
Count
Source
447
20
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
20
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
20
        }
451
20
        Ok(self.push(elem))
452
20
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_push
Line
Count
Source
447
64.0k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
64.0k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
64.0k
        }
451
64.0k
        Ok(self.push(elem))
452
64.0k
    }
<alloc::vec::Vec<mp4parse::FLACMetadataBlock> as fallible_collections::vec::FallibleVec<mp4parse::FLACMetadataBlock>>::try_push
Line
Count
Source
447
442k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
442k
        if self.len() == self.capacity() {
449
290
            self.try_reserve(1)?;
450
441k
        }
451
442k
        Ok(self.push(elem))
452
442k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_push
Line
Count
Source
447
2.12k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
2.12k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
2.12k
        }
451
2.12k
        Ok(self.push(elem))
452
2.12k
    }
<alloc::vec::Vec<mp4parse::ProtectionSchemeInfoBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSchemeInfoBox>>::try_push
Line
Count
Source
447
10.5k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
10.5k
        if self.len() == self.capacity() {
449
3.59k
            self.try_reserve(1)?;
450
6.92k
        }
451
10.5k
        Ok(self.push(elem))
452
10.5k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_push
Line
Count
Source
447
21.8k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
21.8k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
21.8k
        }
451
21.8k
        Ok(self.push(elem))
452
21.8k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_push
Line
Count
Source
447
40
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
40
        if self.len() == self.capacity() {
449
19
            self.try_reserve(1)?;
450
21
        }
451
40
        Ok(self.push(elem))
452
40
    }
<alloc::vec::Vec<mp4parse::ProtectionSystemSpecificHeaderBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::try_push
Line
Count
Source
447
4.84k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
4.84k
        if self.len() == self.capacity() {
449
189
            self.try_reserve(1)?;
450
4.65k
        }
451
4.84k
        Ok(self.push(elem))
452
4.84k
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_push
Line
Count
Source
447
204k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
204k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
204k
        }
451
204k
        Ok(self.push(elem))
452
204k
    }
<alloc::vec::Vec<mp4parse::Track> as fallible_collections::vec::FallibleVec<mp4parse::Track>>::try_push
Line
Count
Source
447
53.0k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
53.0k
        if self.len() == self.capacity() {
449
2.07k
            self.try_reserve(1)?;
450
50.9k
        }
451
53.0k
        Ok(self.push(elem))
452
53.0k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_push
Line
Count
Source
447
1.01M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
1.01M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
1.01M
        }
451
1.01M
        Ok(self.push(elem))
452
1.01M
    }
<alloc::vec::Vec<mp4parse::ItemId> as fallible_collections::vec::FallibleVec<mp4parse::ItemId>>::try_push
Line
Count
Source
447
8
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
8
        if self.len() == self.capacity() {
449
7
            self.try_reserve(1)?;
450
1
        }
451
8
        Ok(self.push(elem))
452
8
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_push
Line
Count
Source
447
40.8k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
40.8k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
40.8k
        }
451
40.8k
        Ok(self.push(elem))
452
40.8k
    }
<alloc::vec::Vec<mp4parse::DataBox> as fallible_collections::vec::FallibleVec<mp4parse::DataBox>>::try_push
Line
Count
Source
447
37.6k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
37.6k
        if self.len() == self.capacity() {
449
166
            self.try_reserve(1)?;
450
37.4k
        }
451
37.6k
        Ok(self.push(elem))
452
37.6k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_push
Line
Count
Source
447
16.0k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
16.0k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
16.0k
        }
451
16.0k
        Ok(self.push(elem))
452
16.0k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_push
Line
Count
Source
447
6.27k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
6.27k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
6.27k
        }
451
6.27k
        Ok(self.push(elem))
452
6.27k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_push
Line
Count
Source
447
280k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
280k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
280k
        }
451
280k
        Ok(self.push(elem))
452
280k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_push
Line
Count
Source
447
19
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
19
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
19
        }
451
19
        Ok(self.push(elem))
452
19
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_push
Line
Count
Source
447
230k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
230k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
230k
        }
451
230k
        Ok(self.push(elem))
452
230k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_push
Line
Count
Source
447
391k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
391k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
391k
        }
451
391k
        Ok(self.push(elem))
452
391k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_push
Line
Count
Source
447
136M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
136M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
136M
        }
451
136M
        Ok(self.push(elem))
452
136M
    }
<alloc::vec::Vec<&mp4parse::ItemProperty> as fallible_collections::vec::FallibleVec<&mp4parse::ItemProperty>>::try_push
Line
Count
Source
447
70
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
70
        if self.len() == self.capacity() {
449
70
            self.try_reserve(1)?;
450
0
        }
451
70
        Ok(self.push(elem))
452
70
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_push
Line
Count
Source
447
135M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
135M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
135M
        }
451
135M
        Ok(self.push(elem))
452
135M
    }
Unexecuted instantiation: <alloc::vec::Vec<_> as fallible_collections::vec::FallibleVec<_>>::try_push
453
454
    #[inline]
455
0
    fn try_push_give_back(&mut self, elem: T) -> Result<(), (T, TryReserveError)> {
456
0
        if self.len() == self.capacity() {
457
0
            if let Err(e) = self.try_reserve(1) {
458
0
                return Err((elem, e));
459
0
            }
460
0
        }
461
0
        Ok(self.push(elem))
462
0
    }
463
464
    #[inline]
465
175k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
175k
    where
467
175k
        Self: core::marker::Sized,
468
    {
469
175k
        let mut n = Self::new();
470
175k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
175k
        Ok(n)
472
175k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_with_capacity
Line
Count
Source
465
1.54k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
1.54k
    where
467
1.54k
        Self: core::marker::Sized,
468
    {
469
1.54k
        let mut n = Self::new();
470
1.54k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
1.54k
        Ok(n)
472
1.54k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_with_capacity
Line
Count
Source
465
20
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
20
    where
467
20
        Self: core::marker::Sized,
468
    {
469
20
        let mut n = Self::new();
470
20
        FallibleVec::try_reserve(&mut n, capacity)?;
471
20
        Ok(n)
472
20
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_with_capacity
Line
Count
Source
465
35.5k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
35.5k
    where
467
35.5k
        Self: core::marker::Sized,
468
    {
469
35.5k
        let mut n = Self::new();
470
35.5k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
35.5k
        Ok(n)
472
35.5k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_with_capacity
Line
Count
Source
465
20
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
20
    where
467
20
        Self: core::marker::Sized,
468
    {
469
20
        let mut n = Self::new();
470
20
        FallibleVec::try_reserve(&mut n, capacity)?;
471
20
        Ok(n)
472
20
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_with_capacity
Line
Count
Source
465
33.9k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
33.9k
    where
467
33.9k
        Self: core::marker::Sized,
468
    {
469
33.9k
        let mut n = Self::new();
470
33.9k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
33.9k
        Ok(n)
472
33.9k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_with_capacity
Line
Count
Source
465
2.39k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
2.39k
    where
467
2.39k
        Self: core::marker::Sized,
468
    {
469
2.39k
        let mut n = Self::new();
470
2.39k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
2.39k
        Ok(n)
472
2.39k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_with_capacity
Line
Count
Source
465
19
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
19
    where
467
19
        Self: core::marker::Sized,
468
    {
469
19
        let mut n = Self::new();
470
19
        FallibleVec::try_reserve(&mut n, capacity)?;
471
19
        Ok(n)
472
19
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_with_capacity
Line
Count
Source
465
11.2k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
11.2k
    where
467
11.2k
        Self: core::marker::Sized,
468
    {
469
11.2k
        let mut n = Self::new();
470
11.2k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
11.2k
        Ok(n)
472
11.2k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_with_capacity
Line
Count
Source
465
62
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
62
    where
467
62
        Self: core::marker::Sized,
468
    {
469
62
        let mut n = Self::new();
470
62
        FallibleVec::try_reserve(&mut n, capacity)?;
471
62
        Ok(n)
472
62
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_with_capacity
Line
Count
Source
465
22.5k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
22.5k
    where
467
22.5k
        Self: core::marker::Sized,
468
    {
469
22.5k
        let mut n = Self::new();
470
22.5k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
22.5k
        Ok(n)
472
22.5k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_with_capacity
Line
Count
Source
465
17.6k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
17.6k
    where
467
17.6k
        Self: core::marker::Sized,
468
    {
469
17.6k
        let mut n = Self::new();
470
17.6k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
17.6k
        Ok(n)
472
17.6k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_with_capacity
Line
Count
Source
465
5.92k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
5.92k
    where
467
5.92k
        Self: core::marker::Sized,
468
    {
469
5.92k
        let mut n = Self::new();
470
5.92k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
5.92k
        Ok(n)
472
5.92k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_with_capacity
Line
Count
Source
465
6.20k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
6.20k
    where
467
6.20k
        Self: core::marker::Sized,
468
    {
469
6.20k
        let mut n = Self::new();
470
6.20k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
6.20k
        Ok(n)
472
6.20k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_with_capacity
Line
Count
Source
465
19
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
19
    where
467
19
        Self: core::marker::Sized,
468
    {
469
19
        let mut n = Self::new();
470
19
        FallibleVec::try_reserve(&mut n, capacity)?;
471
19
        Ok(n)
472
19
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_with_capacity
Line
Count
Source
465
5.51k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
5.51k
    where
467
5.51k
        Self: core::marker::Sized,
468
    {
469
5.51k
        let mut n = Self::new();
470
5.51k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
5.51k
        Ok(n)
472
5.51k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_with_capacity
Line
Count
Source
465
32.0k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
32.0k
    where
467
32.0k
        Self: core::marker::Sized,
468
    {
469
32.0k
        let mut n = Self::new();
470
32.0k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
32.0k
        Ok(n)
472
32.0k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_with_capacity
Line
Count
Source
465
487
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
487
    where
467
487
        Self: core::marker::Sized,
468
    {
469
487
        let mut n = Self::new();
470
487
        FallibleVec::try_reserve(&mut n, capacity)?;
471
486
        Ok(n)
472
487
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_with_capacity
Line
Count
Source
465
84
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
84
    where
467
84
        Self: core::marker::Sized,
468
    {
469
84
        let mut n = Self::new();
470
84
        FallibleVec::try_reserve(&mut n, capacity)?;
471
84
        Ok(n)
472
84
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_with_capacity
Line
Count
Source
465
219
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
219
    where
467
219
        Self: core::marker::Sized,
468
    {
469
219
        let mut n = Self::new();
470
219
        FallibleVec::try_reserve(&mut n, capacity)?;
471
219
        Ok(n)
472
219
    }
473
474
    #[inline]
475
0
    fn try_insert(&mut self, index: usize, element: T) -> Result<(), (T, TryReserveError)> {
476
0
        if self.len() == self.capacity() {
477
0
            if let Err(e) = self.try_reserve(1) {
478
0
                return Err((element, e));
479
0
            }
480
0
        }
481
0
        Ok(self.insert(index, element))
482
0
    }
483
484
    #[inline]
485
4.84k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
4.84k
        FallibleVec::try_reserve(self, other.len())?;
487
4.84k
        Ok(self.append(other))
488
4.84k
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_append
Line
Count
Source
485
4.84k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
4.84k
        FallibleVec::try_reserve(self, other.len())?;
487
4.84k
        Ok(self.append(other))
488
4.84k
    }
Unexecuted instantiation: <alloc::vec::Vec<_> as fallible_collections::vec::FallibleVec<_>>::try_append
489
490
0
    fn try_resize(&mut self, new_len: usize, value: T) -> Result<(), TryReserveError>
491
0
    where
492
0
        T: Copy + Clone,
493
    {
494
0
        let len = self.len();
495
0
        if new_len > len {
496
0
            FallibleVec::try_reserve(self, new_len - len)?;
497
0
        }
498
0
        Ok(self.resize(new_len, value))
499
0
    }
500
501
0
    fn try_resize_with<F>(&mut self, new_len: usize, f: F) -> Result<(), TryReserveError>
502
0
    where
503
0
        F: FnMut() -> T,
504
    {
505
0
        let len = self.len();
506
0
        if new_len > len {
507
0
            FallibleVec::try_reserve(self, new_len - len)?;
508
0
        }
509
0
        Ok(self.resize_with(new_len, f))
510
0
    }
511
512
0
    fn try_resize_no_copy(&mut self, new_len: usize, value: T) -> Result<(), TryReserveError>
513
0
    where
514
0
        T: TryClone,
515
    {
516
0
        let len = self.len();
517
518
0
        if new_len > len {
519
0
            self.try_extend_with(new_len - len, TryExtendElement(value))
520
        } else {
521
0
            Ok(Truncate::truncate(self, new_len))
522
        }
523
0
    }
524
525
    #[inline]
526
0
    fn try_extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError>
527
0
    where
528
0
        T: Clone,
529
    {
530
0
        if needs_to_grow(self, other.len()) {
531
0
            self.try_reserve(other.len())?;
532
0
        }
533
0
        Ok(self.extend_from_slice(other))
534
0
    }
535
536
131k
    fn try_extend_from_slice_no_copy(&mut self, other: &[T]) -> Result<(), TryReserveError>
537
131k
    where
538
131k
        T: TryClone,
539
    {
540
131k
        if needs_to_grow(self, other.len()) {
541
60.7k
            self.try_reserve(other.len())?;
542
71.0k
        }
543
131k
        let mut len = self.len();
544
131k
        let mut iterator = other.iter();
545
5.43M
        while let Some(element) = iterator.next() {
546
            unsafe {
547
5.29M
                core::ptr::write(self.as_mut_ptr().add(len), element.try_clone()?);
548
                // NB can't overflow since we would have had to alloc the address space
549
5.29M
                len += 1;
550
5.29M
                self.set_len(len);
551
            }
552
        }
553
131k
        Ok(())
554
131k
    }
555
}
556
557
trait ExtendWith<T> {
558
    fn next(&mut self) -> Result<T, TryReserveError>;
559
    fn last(self) -> T;
560
}
561
562
struct TryExtendElement<T: TryClone>(T);
563
impl<T: TryClone> ExtendWith<T> for TryExtendElement<T> {
564
    #[inline(always)]
565
0
    fn next(&mut self) -> Result<T, TryReserveError> {
566
0
        self.0.try_clone()
567
0
    }
568
    #[inline(always)]
569
0
    fn last(self) -> T {
570
0
        self.0
571
0
    }
572
}
573
574
trait TryExtend<T> {
575
    fn try_extend_with<E: ExtendWith<T>>(
576
        &mut self,
577
        n: usize,
578
        value: E,
579
    ) -> Result<(), TryReserveError>;
580
}
581
582
impl<T> TryExtend<T> for Vec<T> {
583
    /// Extend the vector by `n` values, using the given generator.
584
0
    fn try_extend_with<E: ExtendWith<T>>(
585
0
        &mut self,
586
0
        n: usize,
587
0
        mut value: E,
588
0
    ) -> Result<(), TryReserveError> {
589
0
        if needs_to_grow(self, n) {
590
0
            self.try_reserve(n)?;
591
0
        }
592
593
        unsafe {
594
0
            let mut ptr = self.as_mut_ptr().add(self.len());
595
596
0
            let mut local_len = self.len();
597
            // Write all elements except the last one
598
0
            for _ in 1..n {
599
0
                core::ptr::write(ptr, value.next()?);
600
0
                ptr = ptr.offset(1);
601
                // Increment the length in every step in case next() panics
602
0
                local_len += 1;
603
0
                self.set_len(local_len);
604
            }
605
606
0
            if n > 0 {
607
0
                // We can write the last element directly without cloning needlessly
608
0
                core::ptr::write(ptr, value.last());
609
0
                local_len += 1;
610
0
                self.set_len(local_len);
611
0
            }
612
613
            // len set by scope guard
614
        }
615
0
        Ok(())
616
0
    }
617
}
618
619
trait Truncate {
620
    fn truncate(&mut self, len: usize);
621
}
622
623
impl<T> Truncate for Vec<T> {
624
0
    fn truncate(&mut self, len: usize) {
625
0
        let current_len = self.len();
626
        unsafe {
627
0
            let mut ptr = self.as_mut_ptr().add(current_len);
628
            // Set the final length at the end, keeping in mind that
629
            // dropping an element might panic. Works around a missed
630
            // optimization, as seen in the following issue:
631
            // https://github.com/rust-lang/rust/issues/51802
632
0
            let mut local_len = self.len();
633
634
            // drop any extra elements
635
0
            for _ in len..current_len {
636
0
                ptr = ptr.offset(-1);
637
0
                core::ptr::drop_in_place(ptr);
638
0
                local_len -= 1;
639
0
                self.set_len(local_len);
640
0
            }
641
        }
642
0
    }
643
}
644
645
/// try creating a vec from an `elem` cloned `n` times, see std::from_elem
646
#[cfg(feature = "unstable")]
647
pub fn try_from_elem<T: TryClone>(elem: T, n: usize) -> Result<Vec<T>, TryReserveError> {
648
    <T as SpecFromElem>::try_from_elem(elem, n)
649
}
650
651
// Specialization trait used for Vec::from_elem
652
#[cfg(feature = "unstable")]
653
trait SpecFromElem: Sized {
654
    fn try_from_elem(elem: Self, n: usize) -> Result<Vec<Self>, TryReserveError>;
655
}
656
657
#[cfg(feature = "unstable")]
658
impl<T: TryClone> SpecFromElem for T {
659
    default fn try_from_elem(elem: Self, n: usize) -> Result<Vec<T>, TryReserveError> {
660
        let mut v = Vec::new();
661
        v.try_resize_no_copy(n, elem)?;
662
        Ok(v)
663
    }
664
}
665
666
#[cfg(feature = "unstable")]
667
impl SpecFromElem for u8 {
668
    #[inline]
669
    fn try_from_elem(elem: u8, n: usize) -> Result<Vec<u8>, TryReserveError> {
670
        unsafe {
671
            let mut v: Vec<u8> = FallibleVec::try_with_capacity(n)?;
672
            core::ptr::write_bytes(v.as_mut_ptr(), elem, n);
673
            v.set_len(n);
674
            Ok(v)
675
        }
676
    }
677
}
678
679
impl<T: TryClone> TryClone for Vec<T> {
680
    #[inline]
681
0
    fn try_clone(&self) -> Result<Self, TryReserveError>
682
0
    where
683
0
        Self: core::marker::Sized,
684
    {
685
0
        let mut v = Vec::new();
686
0
        v.try_extend_from_slice_no_copy(self)?;
687
0
        Ok(v)
688
0
    }
689
}
690
691
pub trait TryFromIterator<I>: Sized {
692
    fn try_from_iterator<T: IntoIterator<Item = I>>(iterator: T) -> Result<Self, TryReserveError>;
693
}
694
695
impl<I> TryFromIterator<I> for Vec<I> {
696
0
    fn try_from_iterator<T: IntoIterator<Item = I>>(iterator: T) -> Result<Self, TryReserveError>
697
0
    where
698
0
        T: IntoIterator<Item = I>,
699
    {
700
0
        let mut new = Self::new();
701
0
        for i in iterator {
702
0
            new.try_push(i)?;
703
        }
704
0
        Ok(new)
705
0
    }
706
}
707
708
pub trait TryCollect<I> {
709
    fn try_collect<C: TryFromIterator<I>>(self) -> Result<C, TryReserveError>;
710
}
711
712
impl<I, T> TryCollect<I> for T
713
where
714
    T: IntoIterator<Item = I>,
715
{
716
    #[inline(always)]
717
0
    fn try_collect<C: TryFromIterator<I>>(self) -> Result<C, TryReserveError> {
718
0
        C::try_from_iterator(self)
719
0
    }
720
}
721
722
#[cfg(test)]
723
mod tests {
724
    use super::*;
725
726
    #[test]
727
    #[cfg(feature = "unstable")]
728
    fn vec() {
729
        // let v: Vec<u8> = from_elem(1, 10);
730
        let v: Vec<Vec<u8>> = try_vec![try_vec![42; 10].unwrap(); 100].unwrap();
731
        println!("{:?}", v);
732
        let v2 = try_vec![0, 1, 2];
733
        println!("{:?}", v2);
734
        assert_eq!(2 + 2, 4);
735
    }
736
737
    #[test]
738
    fn try_clone_vec() {
739
        // let v: Vec<u8> = from_elem(1, 10);
740
        let v = vec![42; 100];
741
        assert_eq!(v.try_clone().unwrap(), v);
742
    }
743
744
    #[test]
745
    fn try_clone_oom() {
746
        let layout = Layout::new::<u8>();
747
        let v = unsafe {
748
            Vec::<u8>::from_raw_parts(
749
                alloc(layout),
750
                core::isize::MAX as usize,
751
                core::isize::MAX as usize,
752
            )
753
        };
754
        assert!(v.try_clone().is_err());
755
    }
756
757
    #[test]
758
    fn tryvec_try_clone_oom() {
759
        let layout = Layout::new::<u8>();
760
        let inner = unsafe {
761
            Vec::<u8>::from_raw_parts(
762
                alloc(layout),
763
                core::isize::MAX as usize,
764
                core::isize::MAX as usize,
765
            )
766
        };
767
        let tv = TryVec { inner };
768
        assert!(tv.try_clone().is_err());
769
    }
770
771
    // #[test]
772
    // fn try_out_of_mem() {
773
    //     let v = try_vec![42_u8; 1000000000];
774
    //     assert_eq!(v.try_clone().unwrap(), v);
775
    // }
776
777
    #[test]
778
    fn oom() {
779
        let mut vec: Vec<char> = Vec::new();
780
        match FallibleVec::try_reserve(&mut vec, core::usize::MAX / std::mem::size_of::<char>()) {
781
            Ok(_) => panic!("it should be OOM"),
782
            _ => (),
783
        }
784
        match FallibleVec::try_reserve(&mut vec, core::usize::MAX) {
785
            Ok(_) => panic!("it should be OOM"),
786
            _ => (),
787
        }
788
    }
789
790
    #[test]
791
    fn tryvec_oom() {
792
        let mut vec: TryVec<char> = TryVec::new();
793
        match vec.reserve(core::usize::MAX / std::mem::size_of::<char>()) {
794
            Ok(_) => panic!("it should be OOM"),
795
            _ => (),
796
        }
797
        match vec.reserve(core::usize::MAX) {
798
            Ok(_) => panic!("it should be OOM"),
799
            _ => (),
800
        }
801
    }
802
803
    #[test]
804
    fn try_reserve() {
805
        let mut vec: Vec<_> = vec![1];
806
        let additional_room = vec.capacity() - vec.len();
807
        let additional = additional_room + 1;
808
        let old_cap = vec.capacity();
809
        FallibleVec::try_reserve(&mut vec, additional).unwrap();
810
        assert!(vec.capacity() > old_cap);
811
    }
812
813
    #[test]
814
    fn tryvec_reserve() {
815
        let mut vec: TryVec<_> = vec![1].into();
816
        let old_cap = vec.inner.capacity();
817
        let new_cap = old_cap + 1;
818
        vec.reserve(new_cap).unwrap();
819
        assert!(vec.inner.capacity() >= new_cap);
820
    }
821
822
    #[test]
823
    fn try_reserve_idempotent() {
824
        let mut vec: Vec<_> = vec![1];
825
        let additional_room = vec.capacity() - vec.len();
826
        let additional = additional_room + 1;
827
        FallibleVec::try_reserve(&mut vec, additional).unwrap();
828
        let cap_after_reserve = vec.capacity();
829
        FallibleVec::try_reserve(&mut vec, additional).unwrap();
830
        assert_eq!(vec.capacity(), cap_after_reserve);
831
    }
832
833
    #[test]
834
    fn tryvec_reserve_idempotent() {
835
        let mut vec: TryVec<_> = vec![1].into();
836
        let old_cap = vec.inner.capacity();
837
        let new_cap = old_cap + 1;
838
        vec.reserve(new_cap).unwrap();
839
        let cap_after_reserve = vec.inner.capacity();
840
        vec.reserve(new_cap).unwrap();
841
        assert_eq!(cap_after_reserve, vec.inner.capacity());
842
    }
843
844
    #[test]
845
    fn capacity_overflow() {
846
        let mut vec: Vec<_> = vec![1];
847
        match FallibleVec::try_reserve(&mut vec, core::usize::MAX) {
848
            Ok(_) => panic!("capacity calculation should overflow"),
849
            _ => (),
850
        }
851
    }
852
853
    #[test]
854
    fn tryvec_capacity_overflow() {
855
        let mut vec: TryVec<_> = vec![1].into();
856
        match vec.reserve(core::usize::MAX) {
857
            Ok(_) => panic!("capacity calculation should overflow"),
858
            _ => (),
859
        }
860
    }
861
862
    #[test]
863
    fn extend_from_slice() {
864
        let mut vec: Vec<u8> = b"foo".as_ref().into();
865
        vec.shrink_to_fit();
866
        vec.reserve(5);
867
        assert_eq!(8, vec.capacity());
868
        vec.try_extend_from_slice(b"bar").unwrap();
869
        assert_eq!(vec, b"foobar".as_ref());
870
        vec.try_extend_from_slice(b"1").unwrap();
871
        assert_eq!(vec, b"foobar1".as_ref());
872
        assert_eq!(8, vec.capacity());
873
        vec.try_extend_from_slice(b"11").unwrap();
874
        assert_eq!(16, vec.capacity());
875
    }
876
877
    #[test]
878
    fn tryvec_extend_from_slice() {
879
        let mut vec: TryVec<u8> = b"foo".as_ref().try_into().unwrap();
880
        vec.extend_from_slice(b"bar").unwrap();
881
        assert_eq!(vec, b"foobar".as_ref());
882
    }
883
884
    #[test]
885
    fn try_reserve_zst() {
886
        let mut vec: Vec<()> = Vec::new();
887
        assert!(FallibleVec::try_reserve(&mut vec, core::usize::MAX).is_ok());
888
    }
889
}