Coverage Report

Created: 2026-03-26 07:08

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
50.1k
    fn default() -> Self {
75
50.1k
        Self {
76
50.1k
            inner: Default::default(),
77
50.1k
        }
78
50.1k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry> as core::default::Default>::default
Line
Count
Source
74
380
    fn default() -> Self {
75
380
        Self {
76
380
            inner: Default::default(),
77
380
        }
78
380
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox> as core::default::Default>::default
Line
Count
Source
74
338
    fn default() -> Self {
75
338
        Self {
76
338
            inner: Default::default(),
77
338
        }
78
338
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::default::Default>::default
Line
Count
Source
74
643
    fn default() -> Self {
75
643
        Self {
76
643
            inner: Default::default(),
77
643
        }
78
643
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::default::Default>::default
Line
Count
Source
74
3.88k
    fn default() -> Self {
75
3.88k
        Self {
76
3.88k
            inner: Default::default(),
77
3.88k
        }
78
3.88k
    }
<fallible_collections::vec::TryVec<mp4parse::Track> as core::default::Default>::default
Line
Count
Source
74
3.88k
    fn default() -> Self {
75
3.88k
        Self {
76
3.88k
            inner: Default::default(),
77
3.88k
        }
78
3.88k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::default::Default>::default
Line
Count
Source
74
643
    fn default() -> Self {
75
643
        Self {
76
643
            inner: Default::default(),
77
643
        }
78
643
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox> as core::default::Default>::default
Line
Count
Source
74
364
    fn default() -> Self {
75
364
        Self {
76
364
            inner: Default::default(),
77
364
        }
78
364
    }
<fallible_collections::vec::TryVec<u8> as core::default::Default>::default
Line
Count
Source
74
40.0k
    fn default() -> Self {
75
40.0k
        Self {
76
40.0k
            inner: Default::default(),
77
40.0k
        }
78
40.0k
    }
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
906k
    pub fn new() -> Self {
91
906k
        Self { inner: Vec::new() }
92
906k
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
735k
    pub fn new() -> Self {
91
735k
        Self { inner: Vec::new() }
92
735k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::new
Line
Count
Source
90
81.3k
    pub fn new() -> Self {
91
81.3k
        Self { inner: Vec::new() }
92
81.3k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::new
Line
Count
Source
90
51
    pub fn new() -> Self {
91
51
        Self { inner: Vec::new() }
92
51
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::new
Line
Count
Source
90
56.1k
    pub fn new() -> Self {
91
56.1k
        Self { inner: Vec::new() }
92
56.1k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::new
Line
Count
Source
90
153
    pub fn new() -> Self {
91
153
        Self { inner: Vec::new() }
92
153
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::new
Line
Count
Source
90
246
    pub fn new() -> Self {
91
246
        Self { inner: Vec::new() }
92
246
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::new
Line
Count
Source
90
246
    pub fn new() -> Self {
91
246
        Self { inner: Vec::new() }
92
246
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::new
Line
Count
Source
90
3.58k
    pub fn new() -> Self {
91
3.58k
        Self { inner: Vec::new() }
92
3.58k
    }
<fallible_collections::vec::TryVec<u32>>::new
Line
Count
Source
90
29.3k
    pub fn new() -> Self {
91
29.3k
        Self { inner: Vec::new() }
92
29.3k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::new
Line
Count
Source
90
660
    pub fn new() -> Self {
91
660
        Self { inner: Vec::new() }
92
660
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
38
    pub fn new() -> Self {
91
38
        Self { inner: Vec::new() }
92
38
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::new
93
94
    #[inline]
95
187k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
187k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
187k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::with_capacity
Line
Count
Source
95
1.80k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
1.80k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
1.80k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::with_capacity
Line
Count
Source
95
699
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
699
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
699
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::with_capacity
Line
Count
Source
95
37.5k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
37.5k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
37.5k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::with_capacity
Line
Count
Source
95
121
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
121
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
121
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::with_capacity
Line
Count
Source
95
30.7k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
30.7k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
30.7k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::with_capacity
Line
Count
Source
95
6.31k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
6.31k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
6.31k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::with_capacity
Line
Count
Source
95
196
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
196
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
196
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::with_capacity
Line
Count
Source
95
12.2k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
12.2k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
12.2k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::with_capacity
Line
Count
Source
95
1.27k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
1.27k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
1.27k
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::with_capacity
Line
Count
Source
95
22.2k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
22.2k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
22.2k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::with_capacity
Line
Count
Source
95
14.1k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
14.1k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
14.1k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::with_capacity
Line
Count
Source
95
5.53k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
5.53k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
5.53k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::with_capacity
Line
Count
Source
95
8.31k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
8.31k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
8.31k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::with_capacity
Line
Count
Source
95
246
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
246
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
246
    }
<fallible_collections::vec::TryVec<u8>>::with_capacity
Line
Count
Source
95
581
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
581
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
581
    }
<fallible_collections::vec::TryVec<u32>>::with_capacity
Line
Count
Source
95
15.8k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
15.8k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
15.8k
    }
<fallible_collections::vec::TryVec<u64>>::with_capacity
Line
Count
Source
95
28.9k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
28.9k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
28.9k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::with_capacity
Line
Count
Source
95
358
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
358
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
358
    }
<fallible_collections::vec::TryVec<usize>>::with_capacity
Line
Count
Source
95
60
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
60
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
60
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::with_capacity
100
101
    #[inline(always)]
102
4.46k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
4.46k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
4.46k
    }
<fallible_collections::vec::TryVec<u8>>::append
Line
Count
Source
102
4.46k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
4.46k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
4.46k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::append
105
106
    #[inline(always)]
107
330
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
330
        self
109
330
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::as_mut_slice
Line
Count
Source
107
330
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
330
        self
109
330
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_mut_slice
110
111
    #[inline(always)]
112
63.2k
    pub fn as_slice(&self) -> &[T] {
113
63.2k
        self
114
63.2k
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
61.3k
    pub fn as_slice(&self) -> &[T] {
113
61.3k
        self
114
61.3k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::as_slice
Line
Count
Source
112
58
    pub fn as_slice(&self) -> &[T] {
113
58
        self
114
58
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::as_slice
Line
Count
Source
112
715
    pub fn as_slice(&self) -> &[T] {
113
715
        self
114
715
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::as_slice
Line
Count
Source
112
330
    pub fn as_slice(&self) -> &[T] {
113
330
        self
114
330
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::as_slice
Line
Count
Source
112
660
    pub fn as_slice(&self) -> &[T] {
113
660
        self
114
660
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
168
    pub fn as_slice(&self) -> &[T] {
113
168
        self
114
168
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_slice
115
116
    #[inline(always)]
117
0
    pub fn clear(&mut self) {
118
0
        self.inner.clear()
119
0
    }
120
121
    #[cfg(test)]
122
    pub fn into_inner(self) -> Vec<T> {
123
        self.inner
124
    }
125
126
    #[inline(always)]
127
67.4k
    pub fn is_empty(&self) -> bool {
128
67.4k
        self.inner.is_empty()
129
67.4k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::is_empty
Line
Count
Source
127
19.8k
    pub fn is_empty(&self) -> bool {
128
19.8k
        self.inner.is_empty()
129
19.8k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::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_capi::Mp4parseTrackVideoSampleInfo>>::is_empty
Line
Count
Source
127
4.74k
    pub fn is_empty(&self) -> bool {
128
4.74k
        self.inner.is_empty()
129
4.74k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::is_empty
Line
Count
Source
127
11
    pub fn is_empty(&self) -> bool {
128
11
        self.inner.is_empty()
129
11
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::is_empty
Line
Count
Source
127
12.1k
    pub fn is_empty(&self) -> bool {
128
12.1k
        self.inner.is_empty()
129
12.1k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::is_empty
Line
Count
Source
127
1.06k
    pub fn is_empty(&self) -> bool {
128
1.06k
        self.inner.is_empty()
129
1.06k
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::is_empty
Line
Count
Source
127
137
    pub fn is_empty(&self) -> bool {
128
137
        self.inner.is_empty()
129
137
    }
<fallible_collections::vec::TryVec<u64>>::is_empty
Line
Count
Source
127
211
    pub fn is_empty(&self) -> bool {
128
211
        self.inner.is_empty()
129
211
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::is_empty
Line
Count
Source
127
330
    pub fn is_empty(&self) -> bool {
128
330
        self.inner.is_empty()
129
330
    }
<fallible_collections::vec::TryVec<u8>>::is_empty
Line
Count
Source
127
15.8k
    pub fn is_empty(&self) -> bool {
128
15.8k
        self.inner.is_empty()
129
15.8k
    }
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
93.3k
    pub fn iter(&self) -> Iter<T> {
140
93.3k
        Iter {
141
93.3k
            inner: self.inner.iter(),
142
93.3k
        }
143
93.3k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::iter
Line
Count
Source
139
25.4k
    pub fn iter(&self) -> Iter<T> {
140
25.4k
        Iter {
141
25.4k
            inner: self.inner.iter(),
142
25.4k
        }
143
25.4k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::iter
Line
Count
Source
139
19.2k
    pub fn iter(&self) -> Iter<T> {
140
19.2k
        Iter {
141
19.2k
            inner: self.inner.iter(),
142
19.2k
        }
143
19.2k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::iter
Line
Count
Source
139
45.8k
    pub fn iter(&self) -> Iter<T> {
140
45.8k
        Iter {
141
45.8k
            inner: self.inner.iter(),
142
45.8k
        }
143
45.8k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::iter
Line
Count
Source
139
92
    pub fn iter(&self) -> Iter<T> {
140
92
        Iter {
141
92
            inner: self.inner.iter(),
142
92
        }
143
92
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::iter
Line
Count
Source
139
267
    pub fn iter(&self) -> Iter<T> {
140
267
        Iter {
141
267
            inner: self.inner.iter(),
142
267
        }
143
267
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::iter
Line
Count
Source
139
625
    pub fn iter(&self) -> Iter<T> {
140
625
        Iter {
141
625
            inner: self.inner.iter(),
142
625
        }
143
625
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::iter
Line
Count
Source
139
127
    pub fn iter(&self) -> Iter<T> {
140
127
        Iter {
141
127
            inner: self.inner.iter(),
142
127
        }
143
127
    }
<fallible_collections::vec::TryVec<u8>>::iter
Line
Count
Source
139
991
    pub fn iter(&self) -> Iter<T> {
140
991
        Iter {
141
991
            inner: self.inner.iter(),
142
991
        }
143
991
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::iter
Line
Count
Source
139
210
    pub fn iter(&self) -> Iter<T> {
140
210
        Iter {
141
210
            inner: self.inner.iter(),
142
210
        }
143
210
    }
<fallible_collections::vec::TryVec<u32>>::iter
Line
Count
Source
139
358
    pub fn iter(&self) -> Iter<T> {
140
358
        Iter {
141
358
            inner: self.inner.iter(),
142
358
        }
143
358
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::iter
Line
Count
Source
139
107
    pub fn iter(&self) -> Iter<T> {
140
107
        Iter {
141
107
            inner: self.inner.iter(),
142
107
        }
143
107
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::iter
144
145
    #[inline(always)]
146
54.6k
    pub fn pop(&mut self) -> Option<T> {
147
54.6k
        self.inner.pop()
148
54.6k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::pop
Line
Count
Source
146
54.6k
    pub fn pop(&mut self) -> Option<T> {
147
54.6k
        self.inner.pop()
148
54.6k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::pop
149
150
    #[inline(always)]
151
606M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
606M
        FallibleVec::try_push(&mut self.inner, value)
153
606M
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::push
Line
Count
Source
151
12.9k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
12.9k
        FallibleVec::try_push(&mut self.inner, value)
153
12.9k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::push
Line
Count
Source
151
6.30k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
6.30k
        FallibleVec::try_push(&mut self.inner, value)
153
6.30k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::push
Line
Count
Source
151
182k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
182k
        FallibleVec::try_push(&mut self.inner, value)
153
182k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::push
Line
Count
Source
151
468k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
468k
        FallibleVec::try_push(&mut self.inner, value)
153
468k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::push
Line
Count
Source
151
2.54k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
2.54k
        FallibleVec::try_push(&mut self.inner, value)
153
2.54k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::push
Line
Count
Source
151
103k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
103k
        FallibleVec::try_push(&mut self.inner, value)
153
103k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::push
Line
Count
Source
151
924
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
924
        FallibleVec::try_push(&mut self.inner, value)
153
924
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::push
Line
Count
Source
151
70.2k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
70.2k
        FallibleVec::try_push(&mut self.inner, value)
153
70.2k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::push
Line
Count
Source
151
163k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
163k
        FallibleVec::try_push(&mut self.inner, value)
153
163k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::push
Line
Count
Source
151
10.1k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
10.1k
        FallibleVec::try_push(&mut self.inner, value)
153
10.1k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::push
Line
Count
Source
151
13.1k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
13.1k
        FallibleVec::try_push(&mut self.inner, value)
153
13.1k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::push
Line
Count
Source
151
30.0k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
30.0k
        FallibleVec::try_push(&mut self.inner, value)
153
30.0k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::push
Line
Count
Source
151
1.32k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
1.32k
        FallibleVec::try_push(&mut self.inner, value)
153
1.32k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::push
Line
Count
Source
151
4.46k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
4.46k
        FallibleVec::try_push(&mut self.inner, value)
153
4.46k
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::push
Line
Count
Source
151
215k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
215k
        FallibleVec::try_push(&mut self.inner, value)
153
215k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::push
Line
Count
Source
151
52.7k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
52.7k
        FallibleVec::try_push(&mut self.inner, value)
153
52.7k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::push
Line
Count
Source
151
593k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
593k
        FallibleVec::try_push(&mut self.inner, value)
153
593k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::push
Line
Count
Source
151
618
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
618
        FallibleVec::try_push(&mut self.inner, value)
153
618
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::push
Line
Count
Source
151
157k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
157k
        FallibleVec::try_push(&mut self.inner, value)
153
157k
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::push
Line
Count
Source
151
245k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
245k
        FallibleVec::try_push(&mut self.inner, value)
153
245k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::push
Line
Count
Source
151
285k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
285k
        FallibleVec::try_push(&mut self.inner, value)
153
285k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::push
Line
Count
Source
151
200
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
200
        FallibleVec::try_push(&mut self.inner, value)
153
200
    }
<fallible_collections::vec::TryVec<u32>>::push
Line
Count
Source
151
359k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
359k
        FallibleVec::try_push(&mut self.inner, value)
153
359k
    }
<fallible_collections::vec::TryVec<u64>>::push
Line
Count
Source
151
735k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
735k
        FallibleVec::try_push(&mut self.inner, value)
153
735k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::push
Line
Count
Source
151
431
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
431
        FallibleVec::try_push(&mut self.inner, value)
153
431
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::push
Line
Count
Source
151
301M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
301M
        FallibleVec::try_push(&mut self.inner, value)
153
301M
    }
<fallible_collections::vec::TryVec<usize>>::push
Line
Count
Source
151
301M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
301M
        FallibleVec::try_push(&mut self.inner, value)
153
301M
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::push
154
155
    #[inline(always)]
156
739k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
739k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
739k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::reserve
Line
Count
Source
156
1.52k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
1.52k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
1.52k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::reserve
Line
Count
Source
156
894
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
894
        FallibleVec::try_reserve(&mut self.inner, additional)
158
894
    }
<fallible_collections::vec::TryVec<u32>>::reserve
Line
Count
Source
156
19.9k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
19.9k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
19.9k
    }
<fallible_collections::vec::TryVec<u8>>::reserve
Line
Count
Source
156
717k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
717k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
717k
    }
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
110k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
110k
        self.inner.try_extend_from_slice_no_copy(other)
191
110k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
5.40k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
5.40k
        self.inner.try_extend_from_slice_no_copy(other)
191
5.40k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
15.8k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
15.8k
        self.inner.try_extend_from_slice_no_copy(other)
191
15.8k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
89.7k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
89.7k
        self.inner.try_extend_from_slice_no_copy(other)
191
89.7k
    }
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
323
    fn into_iter(self) -> Self::IntoIter {
200
323
        self.inner.into_iter()
201
323
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
199
193
    fn into_iter(self) -> Self::IntoIter {
200
193
        self.inner.into_iter()
201
193
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
199
130
    fn into_iter(self) -> Self::IntoIter {
200
130
        self.inner.into_iter()
201
130
    }
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
34.2k
    fn into_iter(self) -> Self::IntoIter {
210
34.2k
        self.inner.iter()
211
34.2k
    }
<&fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
168
    fn into_iter(self) -> Self::IntoIter {
210
168
        self.inner.iter()
211
168
    }
<&fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
283
    fn into_iter(self) -> Self::IntoIter {
210
283
        self.inner.iter()
211
283
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
625
    fn into_iter(self) -> Self::IntoIter {
210
625
        self.inner.iter()
211
625
    }
<&fallible_collections::vec::TryVec<mp4parse::Track> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
30.8k
    fn into_iter(self) -> Self::IntoIter {
210
30.8k
        self.inner.iter()
211
30.8k
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
1.61k
    fn into_iter(self) -> Self::IntoIter {
210
1.61k
        self.inner.iter()
211
1.61k
    }
<&fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
660
    fn into_iter(self) -> Self::IntoIter {
210
660
        self.inner.iter()
211
660
    }
<&fallible_collections::vec::TryVec<u32> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
62
    fn into_iter(self) -> Self::IntoIter {
210
62
        self.inner.iter()
211
62
    }
<&fallible_collections::vec::TryVec<mp4parse::DataBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
46
    fn into_iter(self) -> Self::IntoIter {
210
46
        self.inner.iter()
211
46
    }
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
715k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
715k
            let mut buf = TryVec::new();
225
715k
            self.try_read_to_end(&mut buf)?;
226
714k
            Ok(buf)
227
715k
        }
<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
4.12k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.12k
            let mut buf = TryVec::new();
225
4.12k
            self.try_read_to_end(&mut buf)?;
226
4.12k
            Ok(buf)
227
4.12k
        }
<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
4.89k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.89k
            let mut buf = TryVec::new();
225
4.89k
            self.try_read_to_end(&mut buf)?;
226
4.89k
            Ok(buf)
227
4.89k
        }
<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
15.1k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
15.1k
            let mut buf = TryVec::new();
225
15.1k
            self.try_read_to_end(&mut buf)?;
226
15.1k
            Ok(buf)
227
15.1k
        }
<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
34.1k
            Ok(buf)
227
34.1k
        }
<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.06k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.06k
            let mut buf = TryVec::new();
225
1.06k
            self.try_read_to_end(&mut buf)?;
226
1.06k
            Ok(buf)
227
1.06k
        }
<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
245k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
245k
            let mut buf = TryVec::new();
225
245k
            self.try_read_to_end(&mut buf)?;
226
245k
            Ok(buf)
227
245k
        }
<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
668
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
668
            let mut buf = TryVec::new();
225
668
            self.try_read_to_end(&mut buf)?;
226
668
            Ok(buf)
227
668
        }
<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
4.81k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.81k
            let mut buf = TryVec::new();
225
4.81k
            self.try_read_to_end(&mut buf)?;
226
4.81k
            Ok(buf)
227
4.81k
        }
<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
34.2k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
34.2k
            let mut buf = TryVec::new();
225
34.2k
            self.try_read_to_end(&mut buf)?;
226
34.1k
            Ok(buf)
227
34.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
20.4k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
20.4k
            let mut buf = TryVec::new();
225
20.4k
            self.try_read_to_end(&mut buf)?;
226
20.1k
            Ok(buf)
227
20.4k
        }
<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
Line
Count
Source
223
7.49k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
7.49k
            let mut buf = TryVec::new();
225
7.49k
            self.try_read_to_end(&mut buf)?;
226
7.49k
            Ok(buf)
227
7.49k
        }
<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.46k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
9.46k
            let mut buf = TryVec::new();
225
9.46k
            self.try_read_to_end(&mut buf)?;
226
9.46k
            Ok(buf)
227
9.46k
        }
<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
11.5k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
11.5k
            let mut buf = TryVec::new();
225
11.5k
            self.try_read_to_end(&mut buf)?;
226
11.5k
            Ok(buf)
227
11.5k
        }
<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
1.06k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.06k
            let mut buf = TryVec::new();
225
1.06k
            self.try_read_to_end(&mut buf)?;
226
1.06k
            Ok(buf)
227
1.06k
        }
<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
95.5k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
95.5k
            let mut buf = TryVec::new();
225
95.5k
            self.try_read_to_end(&mut buf)?;
226
95.5k
            Ok(buf)
227
95.5k
        }
<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
76.3k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
76.3k
            let mut buf = TryVec::new();
225
76.3k
            self.try_read_to_end(&mut buf)?;
226
76.3k
            Ok(buf)
227
76.3k
        }
<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
2.54k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
2.54k
            let mut buf = TryVec::new();
225
2.54k
            self.try_read_to_end(&mut buf)?;
226
2.54k
            Ok(buf)
227
2.54k
        }
<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
3.44k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
3.44k
            let mut buf = TryVec::new();
225
3.44k
            self.try_read_to_end(&mut buf)?;
226
3.44k
            Ok(buf)
227
3.44k
        }
<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
1.13k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.13k
            let mut buf = TryVec::new();
225
1.13k
            self.try_read_to_end(&mut buf)?;
226
1.13k
            Ok(buf)
227
1.13k
        }
<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
141k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
141k
            let mut buf = TryVec::new();
225
141k
            self.try_read_to_end(&mut buf)?;
226
141k
            Ok(buf)
227
141k
        }
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
410k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
410k
            try_read_up_to(self, self.limit(), buf)
246
410k
        }
<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
668
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
668
            try_read_up_to(self, self.limit(), buf)
246
668
        }
<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
4.81k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
4.81k
            try_read_up_to(self, self.limit(), buf)
246
4.81k
        }
<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
34.2k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
34.2k
            try_read_up_to(self, self.limit(), buf)
246
34.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
20.4k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
20.4k
            try_read_up_to(self, self.limit(), buf)
246
20.4k
        }
<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
Line
Count
Source
244
7.49k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
7.49k
            try_read_up_to(self, self.limit(), buf)
246
7.49k
        }
<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.46k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
9.46k
            try_read_up_to(self, self.limit(), buf)
246
9.46k
        }
<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
11.5k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
11.5k
            try_read_up_to(self, self.limit(), buf)
246
11.5k
        }
<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
1.06k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.06k
            try_read_up_to(self, self.limit(), buf)
246
1.06k
        }
<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
95.5k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
95.5k
            try_read_up_to(self, self.limit(), buf)
246
95.5k
        }
<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
76.3k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
76.3k
            try_read_up_to(self, self.limit(), buf)
246
76.3k
        }
<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
2.54k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
2.54k
            try_read_up_to(self, self.limit(), buf)
246
2.54k
        }
<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
3.44k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
3.44k
            try_read_up_to(self, self.limit(), buf)
246
3.44k
        }
<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
1.13k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.13k
            try_read_up_to(self, self.limit(), buf)
246
1.13k
        }
<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
141k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
141k
            try_read_up_to(self, self.limit(), buf)
246
141k
        }
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
717k
    pub fn try_read_up_to<R: Read>(
253
717k
        src: &mut R,
254
717k
        limit: u64,
255
717k
        buf: &mut TryVec<u8>,
256
717k
    ) -> io::Result<usize> {
257
717k
        let additional = limit
258
717k
            .try_into()
259
717k
            .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
717k
        buf.reserve(additional)
261
717k
            .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
41
            .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
260
            .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
716k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
716k
        Ok(bytes_read)
264
717k
    }
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
4.12k
    pub fn try_read_up_to<R: Read>(
253
4.12k
        src: &mut R,
254
4.12k
        limit: u64,
255
4.12k
        buf: &mut TryVec<u8>,
256
4.12k
    ) -> io::Result<usize> {
257
4.12k
        let additional = limit
258
4.12k
            .try_into()
259
4.12k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.12k
        buf.reserve(additional)
261
4.12k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.12k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.12k
        Ok(bytes_read)
264
4.12k
    }
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
4.89k
    pub fn try_read_up_to<R: Read>(
253
4.89k
        src: &mut R,
254
4.89k
        limit: u64,
255
4.89k
        buf: &mut TryVec<u8>,
256
4.89k
    ) -> io::Result<usize> {
257
4.89k
        let additional = limit
258
4.89k
            .try_into()
259
4.89k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.89k
        buf.reserve(additional)
261
4.89k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.89k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.89k
        Ok(bytes_read)
264
4.89k
    }
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
16.5k
    pub fn try_read_up_to<R: Read>(
253
16.5k
        src: &mut R,
254
16.5k
        limit: u64,
255
16.5k
        buf: &mut TryVec<u8>,
256
16.5k
    ) -> io::Result<usize> {
257
16.5k
        let additional = limit
258
16.5k
            .try_into()
259
16.5k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
16.5k
        buf.reserve(additional)
261
16.5k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
16.5k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
16.5k
        Ok(bytes_read)
264
16.5k
    }
fallible_collections::vec::std_io::try_read_up_to::<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
34.1k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
34.1k
        Ok(bytes_read)
264
34.1k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
1.06k
    pub fn try_read_up_to<R: Read>(
253
1.06k
        src: &mut R,
254
1.06k
        limit: u64,
255
1.06k
        buf: &mut TryVec<u8>,
256
1.06k
    ) -> io::Result<usize> {
257
1.06k
        let additional = limit
258
1.06k
            .try_into()
259
1.06k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.06k
        buf.reserve(additional)
261
1.06k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.06k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.06k
        Ok(bytes_read)
264
1.06k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>
Line
Count
Source
252
245k
    pub fn try_read_up_to<R: Read>(
253
245k
        src: &mut R,
254
245k
        limit: u64,
255
245k
        buf: &mut TryVec<u8>,
256
245k
    ) -> io::Result<usize> {
257
245k
        let additional = limit
258
245k
            .try_into()
259
245k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
245k
        buf.reserve(additional)
261
245k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
245k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
245k
        Ok(bytes_read)
264
245k
    }
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
668
    pub fn try_read_up_to<R: Read>(
253
668
        src: &mut R,
254
668
        limit: u64,
255
668
        buf: &mut TryVec<u8>,
256
668
    ) -> io::Result<usize> {
257
668
        let additional = limit
258
668
            .try_into()
259
668
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
668
        buf.reserve(additional)
261
668
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
668
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
668
        Ok(bytes_read)
264
668
    }
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
4.81k
    pub fn try_read_up_to<R: Read>(
253
4.81k
        src: &mut R,
254
4.81k
        limit: u64,
255
4.81k
        buf: &mut TryVec<u8>,
256
4.81k
    ) -> io::Result<usize> {
257
4.81k
        let additional = limit
258
4.81k
            .try_into()
259
4.81k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.81k
        buf.reserve(additional)
261
4.81k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.81k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.81k
        Ok(bytes_read)
264
4.81k
    }
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
34.2k
    pub fn try_read_up_to<R: Read>(
253
34.2k
        src: &mut R,
254
34.2k
        limit: u64,
255
34.2k
        buf: &mut TryVec<u8>,
256
34.2k
    ) -> io::Result<usize> {
257
34.2k
        let additional = limit
258
34.2k
            .try_into()
259
34.2k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
34.2k
        buf.reserve(additional)
261
34.2k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
34.1k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
34.1k
        Ok(bytes_read)
264
34.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
20.4k
    pub fn try_read_up_to<R: Read>(
253
20.4k
        src: &mut R,
254
20.4k
        limit: u64,
255
20.4k
        buf: &mut TryVec<u8>,
256
20.4k
    ) -> io::Result<usize> {
257
20.4k
        let additional = limit
258
20.4k
            .try_into()
259
20.4k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
20.4k
        buf.reserve(additional)
261
20.4k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
20.1k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
20.1k
        Ok(bytes_read)
264
20.4k
    }
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>>>>>>>>>>>>>
Line
Count
Source
252
7.49k
    pub fn try_read_up_to<R: Read>(
253
7.49k
        src: &mut R,
254
7.49k
        limit: u64,
255
7.49k
        buf: &mut TryVec<u8>,
256
7.49k
    ) -> io::Result<usize> {
257
7.49k
        let additional = limit
258
7.49k
            .try_into()
259
7.49k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
7.49k
        buf.reserve(additional)
261
7.49k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
7.49k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
7.49k
        Ok(bytes_read)
264
7.49k
    }
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.46k
    pub fn try_read_up_to<R: Read>(
253
9.46k
        src: &mut R,
254
9.46k
        limit: u64,
255
9.46k
        buf: &mut TryVec<u8>,
256
9.46k
    ) -> io::Result<usize> {
257
9.46k
        let additional = limit
258
9.46k
            .try_into()
259
9.46k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
9.46k
        buf.reserve(additional)
261
9.46k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
9.46k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
9.46k
        Ok(bytes_read)
264
9.46k
    }
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
11.5k
    pub fn try_read_up_to<R: Read>(
253
11.5k
        src: &mut R,
254
11.5k
        limit: u64,
255
11.5k
        buf: &mut TryVec<u8>,
256
11.5k
    ) -> io::Result<usize> {
257
11.5k
        let additional = limit
258
11.5k
            .try_into()
259
11.5k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
11.5k
        buf.reserve(additional)
261
11.5k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
11.5k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
11.5k
        Ok(bytes_read)
264
11.5k
    }
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
1.06k
    pub fn try_read_up_to<R: Read>(
253
1.06k
        src: &mut R,
254
1.06k
        limit: u64,
255
1.06k
        buf: &mut TryVec<u8>,
256
1.06k
    ) -> io::Result<usize> {
257
1.06k
        let additional = limit
258
1.06k
            .try_into()
259
1.06k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.06k
        buf.reserve(additional)
261
1.06k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.06k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.06k
        Ok(bytes_read)
264
1.06k
    }
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
95.5k
    pub fn try_read_up_to<R: Read>(
253
95.5k
        src: &mut R,
254
95.5k
        limit: u64,
255
95.5k
        buf: &mut TryVec<u8>,
256
95.5k
    ) -> io::Result<usize> {
257
95.5k
        let additional = limit
258
95.5k
            .try_into()
259
95.5k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
95.5k
        buf.reserve(additional)
261
95.5k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
95.5k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
95.5k
        Ok(bytes_read)
264
95.5k
    }
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
76.3k
    pub fn try_read_up_to<R: Read>(
253
76.3k
        src: &mut R,
254
76.3k
        limit: u64,
255
76.3k
        buf: &mut TryVec<u8>,
256
76.3k
    ) -> io::Result<usize> {
257
76.3k
        let additional = limit
258
76.3k
            .try_into()
259
76.3k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
76.3k
        buf.reserve(additional)
261
76.3k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
76.3k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
76.3k
        Ok(bytes_read)
264
76.3k
    }
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
2.54k
    pub fn try_read_up_to<R: Read>(
253
2.54k
        src: &mut R,
254
2.54k
        limit: u64,
255
2.54k
        buf: &mut TryVec<u8>,
256
2.54k
    ) -> io::Result<usize> {
257
2.54k
        let additional = limit
258
2.54k
            .try_into()
259
2.54k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
2.54k
        buf.reserve(additional)
261
2.54k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
2.54k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
2.54k
        Ok(bytes_read)
264
2.54k
    }
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
3.44k
    pub fn try_read_up_to<R: Read>(
253
3.44k
        src: &mut R,
254
3.44k
        limit: u64,
255
3.44k
        buf: &mut TryVec<u8>,
256
3.44k
    ) -> io::Result<usize> {
257
3.44k
        let additional = limit
258
3.44k
            .try_into()
259
3.44k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
3.44k
        buf.reserve(additional)
261
3.44k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
3.44k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
3.44k
        Ok(bytes_read)
264
3.44k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
1.13k
    pub fn try_read_up_to<R: Read>(
253
1.13k
        src: &mut R,
254
1.13k
        limit: u64,
255
1.13k
        buf: &mut TryVec<u8>,
256
1.13k
    ) -> io::Result<usize> {
257
1.13k
        let additional = limit
258
1.13k
            .try_into()
259
1.13k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.13k
        buf.reserve(additional)
261
1.13k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.13k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.13k
        Ok(bytes_read)
264
1.13k
    }
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
141k
    pub fn try_read_up_to<R: Read>(
253
141k
        src: &mut R,
254
141k
        limit: u64,
255
141k
        buf: &mut TryVec<u8>,
256
141k
    ) -> io::Result<usize> {
257
141k
        let additional = limit
258
141k
            .try_into()
259
141k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
141k
        buf.reserve(additional)
261
141k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
141k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
141k
        Ok(bytes_read)
264
141k
    }
fallible_collections::vec::std_io::try_read_up_to::<&mut mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>
Line
Count
Source
252
473
    pub fn try_read_up_to<R: Read>(
253
473
        src: &mut R,
254
473
        limit: u64,
255
473
        buf: &mut TryVec<u8>,
256
473
    ) -> io::Result<usize> {
257
473
        let additional = limit
258
473
            .try_into()
259
473
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
473
        buf.reserve(additional)
261
473
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
473
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
473
        Ok(bytes_read)
264
473
    }
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<_>
265
266
    impl Write for TryVec<u8> {
267
89.7k
        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
268
89.7k
            self.extend_from_slice(buf)
269
89.7k
                .map_err(|_| io::Error::new(io::ErrorKind::Other, "extend_from_slice failed"))?;
270
89.7k
            Ok(buf.len())
271
89.7k
        }
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
163k
    fn as_ref(&self) -> &[u8] {
350
163k
        self.inner.as_ref()
351
163k
    }
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
1.15k
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
1.15k
        let mut v = Self::new();
367
1.15k
        v.inner.try_extend_from_slice_no_copy(value)?;
368
1.15k
        Ok(v)
369
1.15k
    }
<fallible_collections::vec::TryVec<u8> as core::convert::TryFrom<&[u8]>>::try_from
Line
Count
Source
365
1.15k
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
1.15k
        let mut v = Self::new();
367
1.15k
        v.inner.try_extend_from_slice_no_copy(value)?;
368
1.15k
        Ok(v)
369
1.15k
    }
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
2.59G
    fn deref(&self) -> &[T] {
388
2.59G
        self.inner.deref()
389
2.59G
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
160k
    fn deref(&self) -> &[T] {
388
160k
        self.inner.deref()
389
160k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock> as core::ops::deref::Deref>::deref
Line
Count
Source
387
22
    fn deref(&self) -> &[T] {
388
22
        self.inner.deref()
389
22
    }
<fallible_collections::vec::TryVec<mp4parse::Track> as core::ops::deref::Deref>::deref
Line
Count
Source
387
173k
    fn deref(&self) -> &[T] {
388
173k
        self.inner.deref()
389
173k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
38.9k
    fn deref(&self) -> &[T] {
388
38.9k
        self.inner.deref()
389
38.9k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
14.2k
    fn deref(&self) -> &[T] {
388
14.2k
        self.inner.deref()
389
14.2k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
330
    fn deref(&self) -> &[T] {
388
330
        self.inner.deref()
389
330
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
537k
    fn deref(&self) -> &[T] {
388
537k
        self.inner.deref()
389
537k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
700
    fn deref(&self) -> &[T] {
388
700
        self.inner.deref()
389
700
    }
<fallible_collections::vec::TryVec<mp4parse::Edit> as core::ops::deref::Deref>::deref
Line
Count
Source
387
29.8k
    fn deref(&self) -> &[T] {
388
29.8k
        self.inner.deref()
389
29.8k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::ops::deref::Deref>::deref
Line
Count
Source
387
132
    fn deref(&self) -> &[T] {
388
132
        self.inner.deref()
389
132
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::ops::deref::Deref>::deref
Line
Count
Source
387
730
    fn deref(&self) -> &[T] {
388
730
        self.inner.deref()
389
730
    }
<fallible_collections::vec::TryVec<(u8, u32)> as core::ops::deref::Deref>::deref
Line
Count
Source
387
201
    fn deref(&self) -> &[T] {
388
201
        self.inner.deref()
389
201
    }
<fallible_collections::vec::TryVec<u32> as core::ops::deref::Deref>::deref
Line
Count
Source
387
70
    fn deref(&self) -> &[T] {
388
70
        self.inner.deref()
389
70
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset> as core::ops::deref::Deref>::deref
Line
Count
Source
387
58
    fn deref(&self) -> &[T] {
388
58
        self.inner.deref()
389
58
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
2.59G
    fn deref(&self) -> &[T] {
388
2.59G
        self.inner.deref()
389
2.59G
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk> as core::ops::deref::Deref>::deref
Line
Count
Source
387
715
    fn deref(&self) -> &[T] {
388
715
        self.inner.deref()
389
715
    }
<fallible_collections::vec::TryVec<mp4parse::Sample> as core::ops::deref::Deref>::deref
Line
Count
Source
387
330
    fn deref(&self) -> &[T] {
388
330
        self.inner.deref()
389
330
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::Deref>::deref
Line
Count
Source
387
60
    fn deref(&self) -> &[T] {
388
60
        self.inner.deref()
389
60
    }
<fallible_collections::vec::TryVec<u64> as core::ops::deref::Deref>::deref
Line
Count
Source
387
140k
    fn deref(&self) -> &[T] {
388
140k
        self.inner.deref()
389
140k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC> as core::ops::deref::Deref>::deref
Line
Count
Source
387
14.3k
    fn deref(&self) -> &[T] {
388
14.3k
        self.inner.deref()
389
14.3k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty> as core::ops::deref::Deref>::deref
Line
Count
Source
387
668
    fn deref(&self) -> &[T] {
388
668
        self.inner.deref()
389
668
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
82.7k
    fn deref(&self) -> &[T] {
388
82.7k
        self.inner.deref()
389
82.7k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::ops::deref::Deref>::deref
390
}
391
392
impl<T> core::ops::DerefMut for TryVec<T> {
393
301M
    fn deref_mut(&mut self) -> &mut [T] {
394
301M
        self.inner.deref_mut()
395
301M
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
301M
    fn deref_mut(&mut self) -> &mut [T] {
394
301M
        self.inner.deref_mut()
395
301M
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
60
    fn deref_mut(&mut self) -> &mut [T] {
394
60
        self.inner.deref_mut()
395
60
    }
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
313M
    fn next(&mut self) -> Option<Self::Item> {
407
313M
        self.inner.next()
408
313M
    }
<fallible_collections::vec::Iter<mp4parse::SampleEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
52.1k
    fn next(&mut self) -> Option<Self::Item> {
407
52.1k
        self.inner.next()
408
52.1k
    }
<fallible_collections::vec::Iter<mp4parse::DataBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
128k
    fn next(&mut self) -> Option<Self::Item> {
407
128k
        self.inner.next()
408
128k
    }
<fallible_collections::vec::Iter<mp4parse::ItemInfoEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
145
    fn next(&mut self) -> Option<Self::Item> {
407
145
        self.inner.next()
408
145
    }
<fallible_collections::vec::Iter<mp4parse::SampleToChunk> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
243
    fn next(&mut self) -> Option<Self::Item> {
407
243
        self.inner.next()
408
243
    }
<fallible_collections::vec::Iter<mp4parse::ProtectionSchemeInfoBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
20.5k
    fn next(&mut self) -> Option<Self::Item> {
407
20.5k
        self.inner.next()
408
20.5k
    }
<fallible_collections::vec::Iter<mp4parse::SingleItemTypeReferenceBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
758
    fn next(&mut self) -> Option<Self::Item> {
407
758
        self.inner.next()
408
758
    }
<fallible_collections::vec::Iter<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
3.46k
    fn next(&mut self) -> Option<Self::Item> {
407
3.46k
        self.inner.next()
408
3.46k
    }
<fallible_collections::vec::Iter<mp4parse::Track> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
11.4M
    fn next(&mut self) -> Option<Self::Item> {
407
11.4M
        self.inner.next()
408
11.4M
    }
<fallible_collections::vec::Iter<u8> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
9.07k
    fn next(&mut self) -> Option<Self::Item> {
407
9.07k
        self.inner.next()
408
9.07k
    }
<fallible_collections::vec::Iter<mp4parse::TrackReferenceEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
173
    fn next(&mut self) -> Option<Self::Item> {
407
173
        self.inner.next()
408
173
    }
<fallible_collections::vec::Iter<u32> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
301M
    fn next(&mut self) -> Option<Self::Item> {
407
301M
        self.inner.next()
408
301M
    }
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
112k
fn needs_to_grow<T>(v: &Vec<T>, len: usize) -> bool {
435
112k
    v.len()
436
112k
        .checked_add(len)
437
112k
        .map_or(true, |needed| needed > v.capacity())
438
112k
}
439
440
impl<T> FallibleVec<T> for Vec<T> {
441
    #[inline(always)]
442
931k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
931k
        self.try_reserve(additional)
444
931k
    }
<alloc::vec::Vec<fallible_collections::vec::TryVec<u8>> as fallible_collections::vec::FallibleVec<fallible_collections::vec::TryVec<u8>>>::try_reserve
Line
Count
Source
442
1.52k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.52k
        self.try_reserve(additional)
444
1.52k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_reserve
Line
Count
Source
442
894
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
894
        self.try_reserve(additional)
444
894
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_reserve
Line
Count
Source
442
35.8k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
35.8k
        self.try_reserve(additional)
444
35.8k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_reserve
Line
Count
Source
442
1.80k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.80k
        self.try_reserve(additional)
444
1.80k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_reserve
Line
Count
Source
442
699
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
699
        self.try_reserve(additional)
444
699
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_reserve
Line
Count
Source
442
37.5k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
37.5k
        self.try_reserve(additional)
444
37.5k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_reserve
Line
Count
Source
442
121
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
121
        self.try_reserve(additional)
444
121
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_reserve
Line
Count
Source
442
30.7k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
30.7k
        self.try_reserve(additional)
444
30.7k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_reserve
Line
Count
Source
442
6.31k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
6.31k
        self.try_reserve(additional)
444
6.31k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_reserve
Line
Count
Source
442
196
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
196
        self.try_reserve(additional)
444
196
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_reserve
Line
Count
Source
442
12.2k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
12.2k
        self.try_reserve(additional)
444
12.2k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_reserve
Line
Count
Source
442
1.27k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.27k
        self.try_reserve(additional)
444
1.27k
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_reserve
Line
Count
Source
442
22.2k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
22.2k
        self.try_reserve(additional)
444
22.2k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_reserve
Line
Count
Source
442
14.1k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
14.1k
        self.try_reserve(additional)
444
14.1k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_reserve
Line
Count
Source
442
5.53k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
5.53k
        self.try_reserve(additional)
444
5.53k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_reserve
Line
Count
Source
442
8.31k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
8.31k
        self.try_reserve(additional)
444
8.31k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_reserve
Line
Count
Source
442
246
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
246
        self.try_reserve(additional)
444
246
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
721k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
721k
        self.try_reserve(additional)
444
721k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_reserve
Line
Count
Source
442
28.9k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
28.9k
        self.try_reserve(additional)
444
28.9k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_reserve
Line
Count
Source
442
358
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
358
        self.try_reserve(additional)
444
358
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_reserve
Line
Count
Source
442
60
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
60
        self.try_reserve(additional)
444
60
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
581
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
581
        self.try_reserve(additional)
444
581
    }
445
446
    #[inline]
447
606M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
606M
        if self.len() == self.capacity() {
449
51.2k
            self.try_reserve(1)?;
450
606M
        }
451
606M
        Ok(self.push(elem))
452
606M
    }
<alloc::vec::Vec<fallible_collections::vec::TryVec<u8>> as fallible_collections::vec::FallibleVec<fallible_collections::vec::TryVec<u8>>>::try_push
Line
Count
Source
447
182k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
182k
        if self.len() == self.capacity() {
449
41.4k
            self.try_reserve(1)?;
450
140k
        }
451
182k
        Ok(self.push(elem))
452
182k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_push
Line
Count
Source
447
468k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
468k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
468k
        }
451
468k
        Ok(self.push(elem))
452
468k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_push
Line
Count
Source
447
2.54k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
2.54k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
2.54k
        }
451
2.54k
        Ok(self.push(elem))
452
2.54k
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_push
Line
Count
Source
447
103k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
103k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
103k
        }
451
103k
        Ok(self.push(elem))
452
103k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_push
Line
Count
Source
447
924
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
924
        if self.len() == self.capacity() {
449
25
            self.try_reserve(1)?;
450
899
        }
451
924
        Ok(self.push(elem))
452
924
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_push
Line
Count
Source
447
70.2k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
70.2k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
70.2k
        }
451
70.2k
        Ok(self.push(elem))
452
70.2k
    }
<alloc::vec::Vec<mp4parse::FLACMetadataBlock> as fallible_collections::vec::FallibleVec<mp4parse::FLACMetadataBlock>>::try_push
Line
Count
Source
447
163k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
163k
        if self.len() == self.capacity() {
449
292
            self.try_reserve(1)?;
450
163k
        }
451
163k
        Ok(self.push(elem))
452
163k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_push
Line
Count
Source
447
10.1k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
10.1k
        if self.len() == self.capacity() {
449
482
            self.try_reserve(1)?;
450
9.67k
        }
451
10.1k
        Ok(self.push(elem))
452
10.1k
    }
<alloc::vec::Vec<mp4parse::ProtectionSchemeInfoBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSchemeInfoBox>>::try_push
Line
Count
Source
447
13.1k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
13.1k
        if self.len() == self.capacity() {
449
4.58k
            self.try_reserve(1)?;
450
8.53k
        }
451
13.1k
        Ok(self.push(elem))
452
13.1k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_push
Line
Count
Source
447
30.0k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
30.0k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
30.0k
        }
451
30.0k
        Ok(self.push(elem))
452
30.0k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_push
Line
Count
Source
447
1.32k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
1.32k
        if self.len() == self.capacity() {
449
252
            self.try_reserve(1)?;
450
1.06k
        }
451
1.32k
        Ok(self.push(elem))
452
1.32k
    }
<alloc::vec::Vec<mp4parse::ProtectionSystemSpecificHeaderBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::try_push
Line
Count
Source
447
4.46k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
4.46k
        if self.len() == self.capacity() {
449
419
            self.try_reserve(1)?;
450
4.04k
        }
451
4.46k
        Ok(self.push(elem))
452
4.46k
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_push
Line
Count
Source
447
215k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
215k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
215k
        }
451
215k
        Ok(self.push(elem))
452
215k
    }
<alloc::vec::Vec<mp4parse::Track> as fallible_collections::vec::FallibleVec<mp4parse::Track>>::try_push
Line
Count
Source
447
52.7k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
52.7k
        if self.len() == self.capacity() {
449
2.55k
            self.try_reserve(1)?;
450
50.1k
        }
451
52.7k
        Ok(self.push(elem))
452
52.7k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_push
Line
Count
Source
447
593k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
593k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
593k
        }
451
593k
        Ok(self.push(elem))
452
593k
    }
<alloc::vec::Vec<mp4parse::ItemId> as fallible_collections::vec::FallibleVec<mp4parse::ItemId>>::try_push
Line
Count
Source
447
618
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
618
        if self.len() == self.capacity() {
449
195
            self.try_reserve(1)?;
450
423
        }
451
618
        Ok(self.push(elem))
452
618
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_push
Line
Count
Source
447
157k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
157k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
157k
        }
451
157k
        Ok(self.push(elem))
452
157k
    }
<alloc::vec::Vec<mp4parse::DataBox> as fallible_collections::vec::FallibleVec<mp4parse::DataBox>>::try_push
Line
Count
Source
447
245k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
245k
        if self.len() == self.capacity() {
449
534
            self.try_reserve(1)?;
450
245k
        }
451
245k
        Ok(self.push(elem))
452
245k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_push
Line
Count
Source
447
12.9k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
12.9k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
12.9k
        }
451
12.9k
        Ok(self.push(elem))
452
12.9k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_push
Line
Count
Source
447
6.30k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
6.30k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
6.30k
        }
451
6.30k
        Ok(self.push(elem))
452
6.30k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_push
Line
Count
Source
447
285k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
285k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
285k
        }
451
285k
        Ok(self.push(elem))
452
285k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_push
Line
Count
Source
447
200
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
200
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
200
        }
451
200
        Ok(self.push(elem))
452
200
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_push
Line
Count
Source
447
359k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
359k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
359k
        }
451
359k
        Ok(self.push(elem))
452
359k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_push
Line
Count
Source
447
735k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
735k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
735k
        }
451
735k
        Ok(self.push(elem))
452
735k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_push
Line
Count
Source
447
301M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
301M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
301M
        }
451
301M
        Ok(self.push(elem))
452
301M
    }
<alloc::vec::Vec<&mp4parse::ItemProperty> as fallible_collections::vec::FallibleVec<&mp4parse::ItemProperty>>::try_push
Line
Count
Source
447
431
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
431
        if self.len() == self.capacity() {
449
411
            self.try_reserve(1)?;
450
20
        }
451
431
        Ok(self.push(elem))
452
431
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_push
Line
Count
Source
447
301M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
301M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
301M
        }
451
301M
        Ok(self.push(elem))
452
301M
    }
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
187k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
187k
    where
467
187k
        Self: core::marker::Sized,
468
    {
469
187k
        let mut n = Self::new();
470
187k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
187k
        Ok(n)
472
187k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_with_capacity
Line
Count
Source
465
1.80k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
1.80k
    where
467
1.80k
        Self: core::marker::Sized,
468
    {
469
1.80k
        let mut n = Self::new();
470
1.80k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
1.80k
        Ok(n)
472
1.80k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_with_capacity
Line
Count
Source
465
699
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
699
    where
467
699
        Self: core::marker::Sized,
468
    {
469
699
        let mut n = Self::new();
470
699
        FallibleVec::try_reserve(&mut n, capacity)?;
471
699
        Ok(n)
472
699
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_with_capacity
Line
Count
Source
465
37.5k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
37.5k
    where
467
37.5k
        Self: core::marker::Sized,
468
    {
469
37.5k
        let mut n = Self::new();
470
37.5k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
37.5k
        Ok(n)
472
37.5k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_with_capacity
Line
Count
Source
465
121
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
121
    where
467
121
        Self: core::marker::Sized,
468
    {
469
121
        let mut n = Self::new();
470
121
        FallibleVec::try_reserve(&mut n, capacity)?;
471
121
        Ok(n)
472
121
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_with_capacity
Line
Count
Source
465
30.7k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
30.7k
    where
467
30.7k
        Self: core::marker::Sized,
468
    {
469
30.7k
        let mut n = Self::new();
470
30.7k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
30.7k
        Ok(n)
472
30.7k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_with_capacity
Line
Count
Source
465
6.31k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
6.31k
    where
467
6.31k
        Self: core::marker::Sized,
468
    {
469
6.31k
        let mut n = Self::new();
470
6.31k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
6.31k
        Ok(n)
472
6.31k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_with_capacity
Line
Count
Source
465
196
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
196
    where
467
196
        Self: core::marker::Sized,
468
    {
469
196
        let mut n = Self::new();
470
196
        FallibleVec::try_reserve(&mut n, capacity)?;
471
196
        Ok(n)
472
196
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_with_capacity
Line
Count
Source
465
12.2k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
12.2k
    where
467
12.2k
        Self: core::marker::Sized,
468
    {
469
12.2k
        let mut n = Self::new();
470
12.2k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
12.2k
        Ok(n)
472
12.2k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_with_capacity
Line
Count
Source
465
1.27k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
1.27k
    where
467
1.27k
        Self: core::marker::Sized,
468
    {
469
1.27k
        let mut n = Self::new();
470
1.27k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
1.27k
        Ok(n)
472
1.27k
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_with_capacity
Line
Count
Source
465
22.2k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
22.2k
    where
467
22.2k
        Self: core::marker::Sized,
468
    {
469
22.2k
        let mut n = Self::new();
470
22.2k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
22.2k
        Ok(n)
472
22.2k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_with_capacity
Line
Count
Source
465
14.1k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
14.1k
    where
467
14.1k
        Self: core::marker::Sized,
468
    {
469
14.1k
        let mut n = Self::new();
470
14.1k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
14.1k
        Ok(n)
472
14.1k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_with_capacity
Line
Count
Source
465
5.53k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
5.53k
    where
467
5.53k
        Self: core::marker::Sized,
468
    {
469
5.53k
        let mut n = Self::new();
470
5.53k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
5.53k
        Ok(n)
472
5.53k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_with_capacity
Line
Count
Source
465
8.31k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
8.31k
    where
467
8.31k
        Self: core::marker::Sized,
468
    {
469
8.31k
        let mut n = Self::new();
470
8.31k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
8.31k
        Ok(n)
472
8.31k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_with_capacity
Line
Count
Source
465
246
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
246
    where
467
246
        Self: core::marker::Sized,
468
    {
469
246
        let mut n = Self::new();
470
246
        FallibleVec::try_reserve(&mut n, capacity)?;
471
246
        Ok(n)
472
246
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_with_capacity
Line
Count
Source
465
15.8k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
15.8k
    where
467
15.8k
        Self: core::marker::Sized,
468
    {
469
15.8k
        let mut n = Self::new();
470
15.8k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
15.8k
        Ok(n)
472
15.8k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_with_capacity
Line
Count
Source
465
28.9k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
28.9k
    where
467
28.9k
        Self: core::marker::Sized,
468
    {
469
28.9k
        let mut n = Self::new();
470
28.9k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
28.9k
        Ok(n)
472
28.9k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_with_capacity
Line
Count
Source
465
358
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
358
    where
467
358
        Self: core::marker::Sized,
468
    {
469
358
        let mut n = Self::new();
470
358
        FallibleVec::try_reserve(&mut n, capacity)?;
471
357
        Ok(n)
472
358
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_with_capacity
Line
Count
Source
465
60
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
60
    where
467
60
        Self: core::marker::Sized,
468
    {
469
60
        let mut n = Self::new();
470
60
        FallibleVec::try_reserve(&mut n, capacity)?;
471
60
        Ok(n)
472
60
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_with_capacity
Line
Count
Source
465
581
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
581
    where
467
581
        Self: core::marker::Sized,
468
    {
469
581
        let mut n = Self::new();
470
581
        FallibleVec::try_reserve(&mut n, capacity)?;
471
581
        Ok(n)
472
581
    }
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.46k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
4.46k
        FallibleVec::try_reserve(self, other.len())?;
487
4.46k
        Ok(self.append(other))
488
4.46k
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_append
Line
Count
Source
485
4.46k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
4.46k
        FallibleVec::try_reserve(self, other.len())?;
487
4.46k
        Ok(self.append(other))
488
4.46k
    }
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
112k
    fn try_extend_from_slice_no_copy(&mut self, other: &[T]) -> Result<(), TryReserveError>
537
112k
    where
538
112k
        T: TryClone,
539
    {
540
112k
        if needs_to_grow(self, other.len()) {
541
53.0k
            self.try_reserve(other.len())?;
542
59.0k
        }
543
112k
        let mut len = self.len();
544
112k
        let mut iterator = other.iter();
545
3.79M
        while let Some(element) = iterator.next() {
546
            unsafe {
547
3.67M
                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
3.67M
                len += 1;
550
3.67M
                self.set_len(len);
551
            }
552
        }
553
112k
        Ok(())
554
112k
    }
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
}