Coverage Report

Created: 2025-11-11 07:07

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
61.5k
    fn default() -> Self {
75
61.5k
        Self {
76
61.5k
            inner: Default::default(),
77
61.5k
        }
78
61.5k
    }
<fallible_collections::vec::TryVec<u8> as core::default::Default>::default
Line
Count
Source
74
51.4k
    fn default() -> Self {
75
51.4k
        Self {
76
51.4k
            inner: Default::default(),
77
51.4k
        }
78
51.4k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::default::Default>::default
Line
Count
Source
74
566
    fn default() -> Self {
75
566
        Self {
76
566
            inner: Default::default(),
77
566
        }
78
566
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::default::Default>::default
Line
Count
Source
74
4.00k
    fn default() -> Self {
75
4.00k
        Self {
76
4.00k
            inner: Default::default(),
77
4.00k
        }
78
4.00k
    }
<fallible_collections::vec::TryVec<mp4parse::Track> as core::default::Default>::default
Line
Count
Source
74
4.00k
    fn default() -> Self {
75
4.00k
        Self {
76
4.00k
            inner: Default::default(),
77
4.00k
        }
78
4.00k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::default::Default>::default
Line
Count
Source
74
566
    fn default() -> Self {
75
566
        Self {
76
566
            inner: Default::default(),
77
566
        }
78
566
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox> as core::default::Default>::default
Line
Count
Source
74
340
    fn default() -> Self {
75
340
        Self {
76
340
            inner: Default::default(),
77
340
        }
78
340
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry> as core::default::Default>::default
Line
Count
Source
74
319
    fn default() -> Self {
75
319
        Self {
76
319
            inner: Default::default(),
77
319
        }
78
319
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox> as core::default::Default>::default
Line
Count
Source
74
312
    fn default() -> Self {
75
312
        Self {
76
312
            inner: Default::default(),
77
312
        }
78
312
    }
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
1.02M
    pub fn new() -> Self {
91
1.02M
        Self { inner: Vec::new() }
92
1.02M
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
840k
    pub fn new() -> Self {
91
840k
        Self { inner: Vec::new() }
92
840k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::new
Line
Count
Source
90
97.1k
    pub fn new() -> Self {
91
97.1k
        Self { inner: Vec::new() }
92
97.1k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::new
Line
Count
Source
90
70
    pub fn new() -> Self {
91
70
        Self { inner: Vec::new() }
92
70
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::new
Line
Count
Source
90
50.8k
    pub fn new() -> Self {
91
50.8k
        Self { inner: Vec::new() }
92
50.8k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::new
Line
Count
Source
90
267
    pub fn new() -> Self {
91
267
        Self { inner: Vec::new() }
92
267
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::new
Line
Count
Source
90
288
    pub fn new() -> Self {
91
288
        Self { inner: Vec::new() }
92
288
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::new
Line
Count
Source
90
288
    pub fn new() -> Self {
91
288
        Self { inner: Vec::new() }
92
288
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::new
Line
Count
Source
90
3.79k
    pub fn new() -> Self {
91
3.79k
        Self { inner: Vec::new() }
92
3.79k
    }
<fallible_collections::vec::TryVec<u32>>::new
Line
Count
Source
90
27.7k
    pub fn new() -> Self {
91
27.7k
        Self { inner: Vec::new() }
92
27.7k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::new
Line
Count
Source
90
819
    pub fn new() -> Self {
91
819
        Self { inner: Vec::new() }
92
819
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
53
    pub fn new() -> Self {
91
53
        Self { inner: Vec::new() }
92
53
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::new
93
94
    #[inline]
95
173k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
173k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
173k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::with_capacity
Line
Count
Source
95
1.60k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
1.60k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
1.60k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::with_capacity
Line
Count
Source
95
625
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
625
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
625
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::with_capacity
Line
Count
Source
95
33.7k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
33.7k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
33.7k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::with_capacity
Line
Count
Source
95
170
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
170
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
170
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::with_capacity
Line
Count
Source
95
30.3k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
30.3k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
30.3k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::with_capacity
Line
Count
Source
95
3.85k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
3.85k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
3.85k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::with_capacity
Line
Count
Source
95
252
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
252
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
252
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::with_capacity
Line
Count
Source
95
11.3k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
11.3k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
11.3k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::with_capacity
Line
Count
Source
95
1.40k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
1.40k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
1.40k
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::with_capacity
Line
Count
Source
95
21.9k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
21.9k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
21.9k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::with_capacity
Line
Count
Source
95
13.1k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
13.1k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
13.1k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::with_capacity
Line
Count
Source
95
6.33k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
6.33k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
6.33k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::with_capacity
Line
Count
Source
95
8.10k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
8.10k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
8.10k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::with_capacity
Line
Count
Source
95
288
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
288
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
288
    }
<fallible_collections::vec::TryVec<u8>>::with_capacity
Line
Count
Source
95
902
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
902
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
902
    }
<fallible_collections::vec::TryVec<u32>>::with_capacity
Line
Count
Source
95
10.6k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
10.6k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
10.6k
    }
<fallible_collections::vec::TryVec<u64>>::with_capacity
Line
Count
Source
95
28.8k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
28.8k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
28.8k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::with_capacity
Line
Count
Source
95
417
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
417
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
417
    }
<fallible_collections::vec::TryVec<usize>>::with_capacity
Line
Count
Source
95
72
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
72
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
72
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::with_capacity
100
101
    #[inline(always)]
102
5.56k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
5.56k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
5.56k
    }
<fallible_collections::vec::TryVec<u8>>::append
Line
Count
Source
102
5.56k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
5.56k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
5.56k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::append
105
106
    #[inline(always)]
107
370
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
370
        self
109
370
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::as_mut_slice
Line
Count
Source
107
370
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
370
        self
109
370
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_mut_slice
110
111
    #[inline(always)]
112
57.3k
    pub fn as_slice(&self) -> &[T] {
113
57.3k
        self
114
57.3k
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
55.0k
    pub fn as_slice(&self) -> &[T] {
113
55.0k
        self
114
55.0k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::as_slice
Line
Count
Source
112
832
    pub fn as_slice(&self) -> &[T] {
113
832
        self
114
832
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::as_slice
Line
Count
Source
112
370
    pub fn as_slice(&self) -> &[T] {
113
370
        self
114
370
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::as_slice
Line
Count
Source
112
819
    pub fn as_slice(&self) -> &[T] {
113
819
        self
114
819
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
198
    pub fn as_slice(&self) -> &[T] {
113
198
        self
114
198
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::as_slice
Line
Count
Source
112
61
    pub fn as_slice(&self) -> &[T] {
113
61
        self
114
61
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_slice
115
116
    #[inline(always)]
117
309
    pub fn clear(&mut self) {
118
309
        self.inner.clear()
119
309
    }
<fallible_collections::vec::TryVec<u8>>::clear
Line
Count
Source
117
309
    pub fn clear(&mut self) {
118
309
        self.inner.clear()
119
309
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::clear
120
121
    #[cfg(test)]
122
    pub fn into_inner(self) -> Vec<T> {
123
        self.inner
124
    }
125
126
    #[inline(always)]
127
54.4k
    pub fn is_empty(&self) -> bool {
128
54.4k
        self.inner.is_empty()
129
54.4k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::is_empty
Line
Count
Source
127
19.7k
    pub fn is_empty(&self) -> bool {
128
19.7k
        self.inner.is_empty()
129
19.7k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::is_empty
Line
Count
Source
127
932
    pub fn is_empty(&self) -> bool {
128
932
        self.inner.is_empty()
129
932
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::is_empty
Line
Count
Source
127
67
    pub fn is_empty(&self) -> bool {
128
67
        self.inner.is_empty()
129
67
    }
<fallible_collections::vec::TryVec<u64>>::is_empty
Line
Count
Source
127
174
    pub fn is_empty(&self) -> bool {
128
174
        self.inner.is_empty()
129
174
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::is_empty
Line
Count
Source
127
12
    pub fn is_empty(&self) -> bool {
128
12
        self.inner.is_empty()
129
12
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::is_empty
Line
Count
Source
127
11.2k
    pub fn is_empty(&self) -> bool {
128
11.2k
        self.inner.is_empty()
129
11.2k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::is_empty
Line
Count
Source
127
370
    pub fn is_empty(&self) -> bool {
128
370
        self.inner.is_empty()
129
370
    }
<fallible_collections::vec::TryVec<u8>>::is_empty
Line
Count
Source
127
21.9k
    pub fn is_empty(&self) -> bool {
128
21.9k
        self.inner.is_empty()
129
21.9k
    }
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
87.4k
    pub fn iter(&self) -> Iter<T> {
140
87.4k
        Iter {
141
87.4k
            inner: self.inner.iter(),
142
87.4k
        }
143
87.4k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::iter
Line
Count
Source
139
19.5k
    pub fn iter(&self) -> Iter<T> {
140
19.5k
        Iter {
141
19.5k
            inner: self.inner.iter(),
142
19.5k
        }
143
19.5k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::iter
Line
Count
Source
139
18.9k
    pub fn iter(&self) -> Iter<T> {
140
18.9k
        Iter {
141
18.9k
            inner: self.inner.iter(),
142
18.9k
        }
143
18.9k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::iter
Line
Count
Source
139
45.7k
    pub fn iter(&self) -> Iter<T> {
140
45.7k
        Iter {
141
45.7k
            inner: self.inner.iter(),
142
45.7k
        }
143
45.7k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::iter
Line
Count
Source
139
165
    pub fn iter(&self) -> Iter<T> {
140
165
        Iter {
141
165
            inner: self.inner.iter(),
142
165
        }
143
165
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::iter
Line
Count
Source
139
118
    pub fn iter(&self) -> Iter<T> {
140
118
        Iter {
141
118
            inner: self.inner.iter(),
142
118
        }
143
118
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::iter
Line
Count
Source
139
301
    pub fn iter(&self) -> Iter<T> {
140
301
        Iter {
141
301
            inner: self.inner.iter(),
142
301
        }
143
301
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::iter
Line
Count
Source
139
620
    pub fn iter(&self) -> Iter<T> {
140
620
        Iter {
141
620
            inner: self.inner.iter(),
142
620
        }
143
620
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::iter
Line
Count
Source
139
178
    pub fn iter(&self) -> Iter<T> {
140
178
        Iter {
141
178
            inner: self.inner.iter(),
142
178
        }
143
178
    }
<fallible_collections::vec::TryVec<u8>>::iter
Line
Count
Source
139
1.38k
    pub fn iter(&self) -> Iter<T> {
140
1.38k
        Iter {
141
1.38k
            inner: self.inner.iter(),
142
1.38k
        }
143
1.38k
    }
<fallible_collections::vec::TryVec<u32>>::iter
Line
Count
Source
139
417
    pub fn iter(&self) -> Iter<T> {
140
417
        Iter {
141
417
            inner: self.inner.iter(),
142
417
        }
143
417
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::iter
Line
Count
Source
139
89
    pub fn iter(&self) -> Iter<T> {
140
89
        Iter {
141
89
            inner: self.inner.iter(),
142
89
        }
143
89
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::iter
144
145
    #[inline(always)]
146
66.1k
    pub fn pop(&mut self) -> Option<T> {
147
66.1k
        self.inner.pop()
148
66.1k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::pop
Line
Count
Source
146
66.1k
    pub fn pop(&mut self) -> Option<T> {
147
66.1k
        self.inner.pop()
148
66.1k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::pop
149
150
    #[inline(always)]
151
217M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
217M
        FallibleVec::try_push(&mut self.inner, value)
153
217M
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::push
Line
Count
Source
151
12.0k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
12.0k
        FallibleVec::try_push(&mut self.inner, value)
153
12.0k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::push
Line
Count
Source
151
6.81k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
6.81k
        FallibleVec::try_push(&mut self.inner, value)
153
6.81k
    }
<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
430k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
430k
        FallibleVec::try_push(&mut self.inner, value)
153
430k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::push
Line
Count
Source
151
3.44k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
3.44k
        FallibleVec::try_push(&mut self.inner, value)
153
3.44k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::push
Line
Count
Source
151
149k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
149k
        FallibleVec::try_push(&mut self.inner, value)
153
149k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::push
Line
Count
Source
151
1.07k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
1.07k
        FallibleVec::try_push(&mut self.inner, value)
153
1.07k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::push
Line
Count
Source
151
65.6k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
65.6k
        FallibleVec::try_push(&mut self.inner, value)
153
65.6k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::push
Line
Count
Source
151
429k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
429k
        FallibleVec::try_push(&mut self.inner, value)
153
429k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::push
Line
Count
Source
151
5.99k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
5.99k
        FallibleVec::try_push(&mut self.inner, value)
153
5.99k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::push
Line
Count
Source
151
35.7k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
35.7k
        FallibleVec::try_push(&mut self.inner, value)
153
35.7k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::push
Line
Count
Source
151
42.4k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
42.4k
        FallibleVec::try_push(&mut self.inner, value)
153
42.4k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::push
Line
Count
Source
151
1.23k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
1.23k
        FallibleVec::try_push(&mut self.inner, value)
153
1.23k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::push
Line
Count
Source
151
5.56k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
5.56k
        FallibleVec::try_push(&mut self.inner, value)
153
5.56k
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::push
Line
Count
Source
151
216k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
216k
        FallibleVec::try_push(&mut self.inner, value)
153
216k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::push
Line
Count
Source
151
41.5k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
41.5k
        FallibleVec::try_push(&mut self.inner, value)
153
41.5k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::push
Line
Count
Source
151
1.11M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
1.11M
        FallibleVec::try_push(&mut self.inner, value)
153
1.11M
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::push
Line
Count
Source
151
656
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
656
        FallibleVec::try_push(&mut self.inner, value)
153
656
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::push
Line
Count
Source
151
28.6k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
28.6k
        FallibleVec::try_push(&mut self.inner, value)
153
28.6k
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::push
Line
Count
Source
151
79.5k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
79.5k
        FallibleVec::try_push(&mut self.inner, value)
153
79.5k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::push
Line
Count
Source
151
327k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
327k
        FallibleVec::try_push(&mut self.inner, value)
153
327k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::push
Line
Count
Source
151
253
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
253
        FallibleVec::try_push(&mut self.inner, value)
153
253
    }
<fallible_collections::vec::TryVec<u32>>::push
Line
Count
Source
151
210k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
210k
        FallibleVec::try_push(&mut self.inner, value)
153
210k
    }
<fallible_collections::vec::TryVec<u64>>::push
Line
Count
Source
151
281k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
281k
        FallibleVec::try_push(&mut self.inner, value)
153
281k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::push
Line
Count
Source
151
107M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
107M
        FallibleVec::try_push(&mut self.inner, value)
153
107M
    }
<fallible_collections::vec::TryVec<usize>>::push
Line
Count
Source
151
107M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
107M
        FallibleVec::try_push(&mut self.inner, value)
153
107M
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::push
Line
Count
Source
151
536
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
536
        FallibleVec::try_push(&mut self.inner, value)
153
536
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::push
154
155
    #[inline(always)]
156
841k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
841k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
841k
    }
<fallible_collections::vec::TryVec<u8>>::reserve
Line
Count
Source
156
821k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
821k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
821k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::reserve
Line
Count
Source
156
1.81k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
1.81k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
1.81k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::reserve
Line
Count
Source
156
868
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
868
        FallibleVec::try_reserve(&mut self.inner, additional)
158
868
    }
<fallible_collections::vec::TryVec<u32>>::reserve
Line
Count
Source
156
17.2k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
17.2k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
17.2k
    }
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
113k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
113k
        self.inner.try_extend_from_slice_no_copy(other)
191
113k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
6.15k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
6.15k
        self.inner.try_extend_from_slice_no_copy(other)
191
6.15k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
21.9k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
21.9k
        self.inner.try_extend_from_slice_no_copy(other)
191
21.9k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
85.3k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
85.3k
        self.inner.try_extend_from_slice_no_copy(other)
191
85.3k
    }
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
411
    fn into_iter(self) -> Self::IntoIter {
200
411
        self.inner.into_iter()
201
411
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
199
252
    fn into_iter(self) -> Self::IntoIter {
200
252
        self.inner.into_iter()
201
252
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
199
159
    fn into_iter(self) -> Self::IntoIter {
200
159
        self.inner.into_iter()
201
159
    }
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
3.75k
    fn into_iter(self) -> Self::IntoIter {
210
3.75k
        self.inner.iter()
211
3.75k
    }
<&fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
122
    fn into_iter(self) -> Self::IntoIter {
210
122
        self.inner.iter()
211
122
    }
<&fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
309
    fn into_iter(self) -> Self::IntoIter {
210
309
        self.inner.iter()
211
309
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
620
    fn into_iter(self) -> Self::IntoIter {
210
620
        self.inner.iter()
211
620
    }
<&fallible_collections::vec::TryVec<u32> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
74
    fn into_iter(self) -> Self::IntoIter {
210
74
        self.inner.iter()
211
74
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
1.75k
    fn into_iter(self) -> Self::IntoIter {
210
1.75k
        self.inner.iter()
211
1.75k
    }
<&fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
819
    fn into_iter(self) -> Self::IntoIter {
210
819
        self.inner.iter()
211
819
    }
<&fallible_collections::vec::TryVec<mp4parse::DataBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
60
    fn into_iter(self) -> Self::IntoIter {
210
60
        self.inner.iter()
211
60
    }
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
819k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
819k
            let mut buf = TryVec::new();
225
819k
            self.try_read_to_end(&mut buf)?;
226
818k
            Ok(buf)
227
819k
        }
<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
3.04k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
3.04k
            let mut buf = TryVec::new();
225
3.04k
            self.try_read_to_end(&mut buf)?;
226
3.04k
            Ok(buf)
227
3.04k
        }
<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.04k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.04k
            let mut buf = TryVec::new();
225
4.04k
            self.try_read_to_end(&mut buf)?;
226
4.04k
            Ok(buf)
227
4.04k
        }
<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
13.8k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
13.8k
            let mut buf = TryVec::new();
225
13.8k
            self.try_read_to_end(&mut buf)?;
226
13.8k
            Ok(buf)
227
13.8k
        }
<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
30.0k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
30.0k
            let mut buf = TryVec::new();
225
30.0k
            self.try_read_to_end(&mut buf)?;
226
30.0k
            Ok(buf)
227
30.0k
        }
<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.20k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.20k
            let mut buf = TryVec::new();
225
1.20k
            self.try_read_to_end(&mut buf)?;
226
1.20k
            Ok(buf)
227
1.20k
        }
<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
79.3k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
79.3k
            let mut buf = TryVec::new();
225
79.3k
            self.try_read_to_end(&mut buf)?;
226
79.3k
            Ok(buf)
227
79.3k
        }
<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
655
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
655
            let mut buf = TryVec::new();
225
655
            self.try_read_to_end(&mut buf)?;
226
655
            Ok(buf)
227
655
        }
<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
5.97k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
5.97k
            let mut buf = TryVec::new();
225
5.97k
            self.try_read_to_end(&mut buf)?;
226
5.97k
            Ok(buf)
227
5.97k
        }
<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
39.7k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
39.7k
            let mut buf = TryVec::new();
225
39.7k
            self.try_read_to_end(&mut buf)?;
226
39.7k
            Ok(buf)
227
39.7k
        }
<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
24.8k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
24.8k
            let mut buf = TryVec::new();
225
24.8k
            self.try_read_to_end(&mut buf)?;
226
24.5k
            Ok(buf)
227
24.8k
        }
<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.18k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
7.18k
            let mut buf = TryVec::new();
225
7.18k
            self.try_read_to_end(&mut buf)?;
226
7.18k
            Ok(buf)
227
7.18k
        }
<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.81k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
9.81k
            let mut buf = TryVec::new();
225
9.81k
            self.try_read_to_end(&mut buf)?;
226
9.81k
            Ok(buf)
227
9.81k
        }
<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
12.8k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
12.8k
            let mut buf = TryVec::new();
225
12.8k
            self.try_read_to_end(&mut buf)?;
226
12.8k
            Ok(buf)
227
12.8k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
6.41k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
6.41k
            let mut buf = TryVec::new();
225
6.41k
            self.try_read_to_end(&mut buf)?;
226
6.41k
            Ok(buf)
227
6.41k
        }
<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
340k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
340k
            let mut buf = TryVec::new();
225
340k
            self.try_read_to_end(&mut buf)?;
226
340k
            Ok(buf)
227
340k
        }
<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
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::OffsetReader<mp4parse_capi::Mp4parseIo>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
3.36k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
3.36k
            let mut buf = TryVec::new();
225
3.36k
            self.try_read_to_end(&mut buf)?;
226
3.36k
            Ok(buf)
227
3.36k
        }
<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
2.33k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
2.33k
            let mut buf = TryVec::new();
225
2.33k
            self.try_read_to_end(&mut buf)?;
226
2.33k
            Ok(buf)
227
2.33k
        }
<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
134k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
134k
            let mut buf = TryVec::new();
225
134k
            self.try_read_to_end(&mut buf)?;
226
134k
            Ok(buf)
227
134k
        }
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
687k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
687k
            try_read_up_to(self, self.limit(), buf)
246
687k
        }
<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
655
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
655
            try_read_up_to(self, self.limit(), buf)
246
655
        }
<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
5.97k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
5.97k
            try_read_up_to(self, self.limit(), buf)
246
5.97k
        }
<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
39.7k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
39.7k
            try_read_up_to(self, self.limit(), buf)
246
39.7k
        }
<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
24.8k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
24.8k
            try_read_up_to(self, self.limit(), buf)
246
24.8k
        }
<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.18k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
7.18k
            try_read_up_to(self, self.limit(), buf)
246
7.18k
        }
<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.81k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
9.81k
            try_read_up_to(self, self.limit(), buf)
246
9.81k
        }
<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
12.8k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
12.8k
            try_read_up_to(self, self.limit(), buf)
246
12.8k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
6.41k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
6.41k
            try_read_up_to(self, self.limit(), buf)
246
6.41k
        }
<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
340k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
340k
            try_read_up_to(self, self.limit(), buf)
246
340k
        }
<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
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::OffsetReader<mp4parse_capi::Mp4parseIo>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
3.36k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
3.36k
            try_read_up_to(self, self.limit(), buf)
246
3.36k
        }
<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
2.33k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
2.33k
            try_read_up_to(self, self.limit(), buf)
246
2.33k
        }
<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
134k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
134k
            try_read_up_to(self, self.limit(), buf)
246
134k
        }
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
821k
    pub fn try_read_up_to<R: Read>(
253
821k
        src: &mut R,
254
821k
        limit: u64,
255
821k
        buf: &mut TryVec<u8>,
256
821k
    ) -> io::Result<usize> {
257
821k
        let additional = limit
258
821k
            .try_into()
259
821k
            .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
821k
        buf.reserve(additional)
261
821k
            .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
49
            .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
336
            .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
821k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
821k
        Ok(bytes_read)
264
821k
    }
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
3.04k
    pub fn try_read_up_to<R: Read>(
253
3.04k
        src: &mut R,
254
3.04k
        limit: u64,
255
3.04k
        buf: &mut TryVec<u8>,
256
3.04k
    ) -> io::Result<usize> {
257
3.04k
        let additional = limit
258
3.04k
            .try_into()
259
3.04k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
3.04k
        buf.reserve(additional)
261
3.04k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
3.04k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
3.04k
        Ok(bytes_read)
264
3.04k
    }
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.04k
    pub fn try_read_up_to<R: Read>(
253
4.04k
        src: &mut R,
254
4.04k
        limit: u64,
255
4.04k
        buf: &mut TryVec<u8>,
256
4.04k
    ) -> io::Result<usize> {
257
4.04k
        let additional = limit
258
4.04k
            .try_into()
259
4.04k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.04k
        buf.reserve(additional)
261
4.04k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.04k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.04k
        Ok(bytes_read)
264
4.04k
    }
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.0k
    pub fn try_read_up_to<R: Read>(
253
16.0k
        src: &mut R,
254
16.0k
        limit: u64,
255
16.0k
        buf: &mut TryVec<u8>,
256
16.0k
    ) -> io::Result<usize> {
257
16.0k
        let additional = limit
258
16.0k
            .try_into()
259
16.0k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
16.0k
        buf.reserve(additional)
261
16.0k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
16.0k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
16.0k
        Ok(bytes_read)
264
16.0k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>
Line
Count
Source
252
30.0k
    pub fn try_read_up_to<R: Read>(
253
30.0k
        src: &mut R,
254
30.0k
        limit: u64,
255
30.0k
        buf: &mut TryVec<u8>,
256
30.0k
    ) -> io::Result<usize> {
257
30.0k
        let additional = limit
258
30.0k
            .try_into()
259
30.0k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
30.0k
        buf.reserve(additional)
261
30.0k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
30.0k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
30.0k
        Ok(bytes_read)
264
30.0k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
1.20k
    pub fn try_read_up_to<R: Read>(
253
1.20k
        src: &mut R,
254
1.20k
        limit: u64,
255
1.20k
        buf: &mut TryVec<u8>,
256
1.20k
    ) -> io::Result<usize> {
257
1.20k
        let additional = limit
258
1.20k
            .try_into()
259
1.20k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.20k
        buf.reserve(additional)
261
1.20k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.20k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.20k
        Ok(bytes_read)
264
1.20k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>
Line
Count
Source
252
79.3k
    pub fn try_read_up_to<R: Read>(
253
79.3k
        src: &mut R,
254
79.3k
        limit: u64,
255
79.3k
        buf: &mut TryVec<u8>,
256
79.3k
    ) -> io::Result<usize> {
257
79.3k
        let additional = limit
258
79.3k
            .try_into()
259
79.3k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
79.3k
        buf.reserve(additional)
261
79.3k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
79.3k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
79.3k
        Ok(bytes_read)
264
79.3k
    }
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
655
    pub fn try_read_up_to<R: Read>(
253
655
        src: &mut R,
254
655
        limit: u64,
255
655
        buf: &mut TryVec<u8>,
256
655
    ) -> io::Result<usize> {
257
655
        let additional = limit
258
655
            .try_into()
259
655
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
655
        buf.reserve(additional)
261
655
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
655
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
655
        Ok(bytes_read)
264
655
    }
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
5.97k
    pub fn try_read_up_to<R: Read>(
253
5.97k
        src: &mut R,
254
5.97k
        limit: u64,
255
5.97k
        buf: &mut TryVec<u8>,
256
5.97k
    ) -> io::Result<usize> {
257
5.97k
        let additional = limit
258
5.97k
            .try_into()
259
5.97k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
5.97k
        buf.reserve(additional)
261
5.97k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
5.97k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
5.97k
        Ok(bytes_read)
264
5.97k
    }
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
39.7k
    pub fn try_read_up_to<R: Read>(
253
39.7k
        src: &mut R,
254
39.7k
        limit: u64,
255
39.7k
        buf: &mut TryVec<u8>,
256
39.7k
    ) -> io::Result<usize> {
257
39.7k
        let additional = limit
258
39.7k
            .try_into()
259
39.7k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
39.7k
        buf.reserve(additional)
261
39.7k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
39.7k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
39.7k
        Ok(bytes_read)
264
39.7k
    }
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
24.8k
    pub fn try_read_up_to<R: Read>(
253
24.8k
        src: &mut R,
254
24.8k
        limit: u64,
255
24.8k
        buf: &mut TryVec<u8>,
256
24.8k
    ) -> io::Result<usize> {
257
24.8k
        let additional = limit
258
24.8k
            .try_into()
259
24.8k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
24.8k
        buf.reserve(additional)
261
24.8k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
24.5k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
24.5k
        Ok(bytes_read)
264
24.8k
    }
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.18k
    pub fn try_read_up_to<R: Read>(
253
7.18k
        src: &mut R,
254
7.18k
        limit: u64,
255
7.18k
        buf: &mut TryVec<u8>,
256
7.18k
    ) -> io::Result<usize> {
257
7.18k
        let additional = limit
258
7.18k
            .try_into()
259
7.18k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
7.18k
        buf.reserve(additional)
261
7.18k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
7.18k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
7.18k
        Ok(bytes_read)
264
7.18k
    }
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.81k
    pub fn try_read_up_to<R: Read>(
253
9.81k
        src: &mut R,
254
9.81k
        limit: u64,
255
9.81k
        buf: &mut TryVec<u8>,
256
9.81k
    ) -> io::Result<usize> {
257
9.81k
        let additional = limit
258
9.81k
            .try_into()
259
9.81k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
9.81k
        buf.reserve(additional)
261
9.81k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
9.81k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
9.81k
        Ok(bytes_read)
264
9.81k
    }
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
12.8k
    pub fn try_read_up_to<R: Read>(
253
12.8k
        src: &mut R,
254
12.8k
        limit: u64,
255
12.8k
        buf: &mut TryVec<u8>,
256
12.8k
    ) -> io::Result<usize> {
257
12.8k
        let additional = limit
258
12.8k
            .try_into()
259
12.8k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
12.8k
        buf.reserve(additional)
261
12.8k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
12.8k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
12.8k
        Ok(bytes_read)
264
12.8k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>>
Line
Count
Source
252
6.41k
    pub fn try_read_up_to<R: Read>(
253
6.41k
        src: &mut R,
254
6.41k
        limit: u64,
255
6.41k
        buf: &mut TryVec<u8>,
256
6.41k
    ) -> io::Result<usize> {
257
6.41k
        let additional = limit
258
6.41k
            .try_into()
259
6.41k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
6.41k
        buf.reserve(additional)
261
6.41k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
6.41k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
6.41k
        Ok(bytes_read)
264
6.41k
    }
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
340k
    pub fn try_read_up_to<R: Read>(
253
340k
        src: &mut R,
254
340k
        limit: u64,
255
340k
        buf: &mut TryVec<u8>,
256
340k
    ) -> io::Result<usize> {
257
340k
        let additional = limit
258
340k
            .try_into()
259
340k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
340k
        buf.reserve(additional)
261
340k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
340k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
340k
        Ok(bytes_read)
264
340k
    }
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
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::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>
Line
Count
Source
252
3.36k
    pub fn try_read_up_to<R: Read>(
253
3.36k
        src: &mut R,
254
3.36k
        limit: u64,
255
3.36k
        buf: &mut TryVec<u8>,
256
3.36k
    ) -> io::Result<usize> {
257
3.36k
        let additional = limit
258
3.36k
            .try_into()
259
3.36k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
3.36k
        buf.reserve(additional)
261
3.36k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
3.36k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
3.36k
        Ok(bytes_read)
264
3.36k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
2.33k
    pub fn try_read_up_to<R: Read>(
253
2.33k
        src: &mut R,
254
2.33k
        limit: u64,
255
2.33k
        buf: &mut TryVec<u8>,
256
2.33k
    ) -> io::Result<usize> {
257
2.33k
        let additional = limit
258
2.33k
            .try_into()
259
2.33k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
2.33k
        buf.reserve(additional)
261
2.33k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
2.33k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
2.33k
        Ok(bytes_read)
264
2.33k
    }
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
134k
    pub fn try_read_up_to<R: Read>(
253
134k
        src: &mut R,
254
134k
        limit: u64,
255
134k
        buf: &mut TryVec<u8>,
256
134k
    ) -> io::Result<usize> {
257
134k
        let additional = limit
258
134k
            .try_into()
259
134k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
134k
        buf.reserve(additional)
261
134k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
134k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
134k
        Ok(bytes_read)
264
134k
    }
fallible_collections::vec::std_io::try_read_up_to::<&mut mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>
Line
Count
Source
252
488
    pub fn try_read_up_to<R: Read>(
253
488
        src: &mut R,
254
488
        limit: u64,
255
488
        buf: &mut TryVec<u8>,
256
488
    ) -> io::Result<usize> {
257
488
        let additional = limit
258
488
            .try_into()
259
488
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
488
        buf.reserve(additional)
261
488
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
488
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
488
        Ok(bytes_read)
264
488
    }
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<_>
265
266
    impl Write for TryVec<u8> {
267
85.3k
        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
268
85.3k
            self.extend_from_slice(buf)
269
85.3k
                .map_err(|_| io::Error::new(io::ErrorKind::Other, "extend_from_slice failed"))?;
270
85.3k
            Ok(buf.len())
271
85.3k
        }
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
161k
    fn as_ref(&self) -> &[u8] {
350
161k
        self.inner.as_ref()
351
161k
    }
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.97k
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
1.97k
        let mut v = Self::new();
367
1.97k
        v.inner.try_extend_from_slice_no_copy(value)?;
368
1.97k
        Ok(v)
369
1.97k
    }
<fallible_collections::vec::TryVec<u8> as core::convert::TryFrom<&[u8]>>::try_from
Line
Count
Source
365
1.97k
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
1.97k
        let mut v = Self::new();
367
1.97k
        v.inner.try_extend_from_slice_no_copy(value)?;
368
1.97k
        Ok(v)
369
1.97k
    }
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
815M
    fn deref(&self) -> &[T] {
388
815M
        self.inner.deref()
389
815M
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
202k
    fn deref(&self) -> &[T] {
388
202k
        self.inner.deref()
389
202k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock> as core::ops::deref::Deref>::deref
Line
Count
Source
387
23
    fn deref(&self) -> &[T] {
388
23
        self.inner.deref()
389
23
    }
<fallible_collections::vec::TryVec<mp4parse::Track> as core::ops::deref::Deref>::deref
Line
Count
Source
387
163k
    fn deref(&self) -> &[T] {
388
163k
        self.inner.deref()
389
163k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
36.2k
    fn deref(&self) -> &[T] {
388
36.2k
        self.inner.deref()
389
36.2k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
16.6k
    fn deref(&self) -> &[T] {
388
16.6k
        self.inner.deref()
389
16.6k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
370
    fn deref(&self) -> &[T] {
388
370
        self.inner.deref()
389
370
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
825k
    fn deref(&self) -> &[T] {
388
825k
        self.inner.deref()
389
825k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
630
    fn deref(&self) -> &[T] {
388
630
        self.inner.deref()
389
630
    }
<fallible_collections::vec::TryVec<mp4parse::Edit> as core::ops::deref::Deref>::deref
Line
Count
Source
387
34.2k
    fn deref(&self) -> &[T] {
388
34.2k
        self.inner.deref()
389
34.2k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::ops::deref::Deref>::deref
Line
Count
Source
387
163
    fn deref(&self) -> &[T] {
388
163
        self.inner.deref()
389
163
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::ops::deref::Deref>::deref
Line
Count
Source
387
762
    fn deref(&self) -> &[T] {
388
762
        self.inner.deref()
389
762
    }
<fallible_collections::vec::TryVec<(u8, u32)> as core::ops::deref::Deref>::deref
Line
Count
Source
387
254
    fn deref(&self) -> &[T] {
388
254
        self.inner.deref()
389
254
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk> as core::ops::deref::Deref>::deref
Line
Count
Source
387
832
    fn deref(&self) -> &[T] {
388
832
        self.inner.deref()
389
832
    }
<fallible_collections::vec::TryVec<mp4parse::Sample> as core::ops::deref::Deref>::deref
Line
Count
Source
387
370
    fn deref(&self) -> &[T] {
388
370
        self.inner.deref()
389
370
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
813M
    fn deref(&self) -> &[T] {
388
813M
        self.inner.deref()
389
813M
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::Deref>::deref
Line
Count
Source
387
72
    fn deref(&self) -> &[T] {
388
72
        self.inner.deref()
389
72
    }
<fallible_collections::vec::TryVec<u64> as core::ops::deref::Deref>::deref
Line
Count
Source
387
80.7k
    fn deref(&self) -> &[T] {
388
80.7k
        self.inner.deref()
389
80.7k
    }
<fallible_collections::vec::TryVec<u32> as core::ops::deref::Deref>::deref
Line
Count
Source
387
57
    fn deref(&self) -> &[T] {
388
57
        self.inner.deref()
389
57
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC> as core::ops::deref::Deref>::deref
Line
Count
Source
387
15.1k
    fn deref(&self) -> &[T] {
388
15.1k
        self.inner.deref()
389
15.1k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty> as core::ops::deref::Deref>::deref
Line
Count
Source
387
839
    fn deref(&self) -> &[T] {
388
839
        self.inner.deref()
389
839
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
1.36k
    fn deref(&self) -> &[T] {
388
1.36k
        self.inner.deref()
389
1.36k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset> as core::ops::deref::Deref>::deref
Line
Count
Source
387
61
    fn deref(&self) -> &[T] {
388
61
        self.inner.deref()
389
61
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::ops::deref::Deref>::deref
390
}
391
392
impl<T> core::ops::DerefMut for TryVec<T> {
393
107M
    fn deref_mut(&mut self) -> &mut [T] {
394
107M
        self.inner.deref_mut()
395
107M
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
107M
    fn deref_mut(&mut self) -> &mut [T] {
394
107M
        self.inner.deref_mut()
395
107M
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
72
    fn deref_mut(&mut self) -> &mut [T] {
394
72
        self.inner.deref_mut()
395
72
    }
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
121M
    fn next(&mut self) -> Option<Self::Item> {
407
121M
        self.inner.next()
408
121M
    }
<fallible_collections::vec::Iter<mp4parse::SampleEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
38.4k
    fn next(&mut self) -> Option<Self::Item> {
407
38.4k
        self.inner.next()
408
38.4k
    }
<fallible_collections::vec::Iter<mp4parse::ItemInfoEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
165
    fn next(&mut self) -> Option<Self::Item> {
407
165
        self.inner.next()
408
165
    }
<fallible_collections::vec::Iter<mp4parse::SampleToChunk> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
209
    fn next(&mut self) -> Option<Self::Item> {
407
209
        self.inner.next()
408
209
    }
<fallible_collections::vec::Iter<mp4parse::ProtectionSchemeInfoBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
20.0k
    fn next(&mut self) -> Option<Self::Item> {
407
20.0k
        self.inner.next()
408
20.0k
    }
<fallible_collections::vec::Iter<mp4parse::SingleItemTypeReferenceBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
870
    fn next(&mut self) -> Option<Self::Item> {
407
870
        self.inner.next()
408
870
    }
<fallible_collections::vec::Iter<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
2.08k
    fn next(&mut self) -> Option<Self::Item> {
407
2.08k
        self.inner.next()
408
2.08k
    }
<fallible_collections::vec::Iter<mp4parse::Track> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
13.9M
    fn next(&mut self) -> Option<Self::Item> {
407
13.9M
        self.inner.next()
408
13.9M
    }
<fallible_collections::vec::Iter<u8> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
15.7k
    fn next(&mut self) -> Option<Self::Item> {
407
15.7k
        self.inner.next()
408
15.7k
    }
<fallible_collections::vec::Iter<mp4parse::DataBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
2.79k
    fn next(&mut self) -> Option<Self::Item> {
407
2.79k
        self.inner.next()
408
2.79k
    }
<fallible_collections::vec::Iter<u32> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
107M
    fn next(&mut self) -> Option<Self::Item> {
407
107M
        self.inner.next()
408
107M
    }
<fallible_collections::vec::Iter<mp4parse::TrackReferenceEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
142
    fn next(&mut self) -> Option<Self::Item> {
407
142
        self.inner.next()
408
142
    }
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
115k
fn needs_to_grow<T>(v: &Vec<T>, len: usize) -> bool {
435
115k
    v.len()
436
115k
        .checked_add(len)
437
115k
        .map_or(true, |needed| needed > v.capacity())
438
115k
}
439
440
impl<T> FallibleVec<T> for Vec<T> {
441
    #[inline(always)]
442
1.02M
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.02M
        self.try_reserve(additional)
444
1.02M
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
827k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
827k
        self.try_reserve(additional)
444
827k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_reserve
Line
Count
Source
442
1.60k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.60k
        self.try_reserve(additional)
444
1.60k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_reserve
Line
Count
Source
442
625
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
625
        self.try_reserve(additional)
444
625
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_reserve
Line
Count
Source
442
33.7k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
33.7k
        self.try_reserve(additional)
444
33.7k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_reserve
Line
Count
Source
442
170
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
170
        self.try_reserve(additional)
444
170
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_reserve
Line
Count
Source
442
30.3k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
30.3k
        self.try_reserve(additional)
444
30.3k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_reserve
Line
Count
Source
442
3.85k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
3.85k
        self.try_reserve(additional)
444
3.85k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_reserve
Line
Count
Source
442
252
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
252
        self.try_reserve(additional)
444
252
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_reserve
Line
Count
Source
442
11.3k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
11.3k
        self.try_reserve(additional)
444
11.3k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_reserve
Line
Count
Source
442
1.40k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.40k
        self.try_reserve(additional)
444
1.40k
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_reserve
Line
Count
Source
442
21.9k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
21.9k
        self.try_reserve(additional)
444
21.9k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_reserve
Line
Count
Source
442
13.1k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
13.1k
        self.try_reserve(additional)
444
13.1k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_reserve
Line
Count
Source
442
6.33k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
6.33k
        self.try_reserve(additional)
444
6.33k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_reserve
Line
Count
Source
442
8.10k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
8.10k
        self.try_reserve(additional)
444
8.10k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_reserve
Line
Count
Source
442
288
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
288
        self.try_reserve(additional)
444
288
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_reserve
Line
Count
Source
442
27.8k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
27.8k
        self.try_reserve(additional)
444
27.8k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_reserve
Line
Count
Source
442
28.8k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
28.8k
        self.try_reserve(additional)
444
28.8k
    }
<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.81k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.81k
        self.try_reserve(additional)
444
1.81k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_reserve
Line
Count
Source
442
868
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
868
        self.try_reserve(additional)
444
868
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_reserve
Line
Count
Source
442
417
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
417
        self.try_reserve(additional)
444
417
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_reserve
Line
Count
Source
442
72
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
72
        self.try_reserve(additional)
444
72
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
902
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
902
        self.try_reserve(additional)
444
902
    }
445
446
    #[inline]
447
217M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
217M
        if self.len() == self.capacity() {
449
57.6k
            self.try_reserve(1)?;
450
217M
        }
451
217M
        Ok(self.push(elem))
452
217M
    }
<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
47.9k
            self.try_reserve(1)?;
450
134k
        }
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
430k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
430k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
430k
        }
451
430k
        Ok(self.push(elem))
452
430k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_push
Line
Count
Source
447
3.44k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
3.44k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
3.44k
        }
451
3.44k
        Ok(self.push(elem))
452
3.44k
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_push
Line
Count
Source
447
149k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
149k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
149k
        }
451
149k
        Ok(self.push(elem))
452
149k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_push
Line
Count
Source
447
1.07k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
1.07k
        if self.len() == self.capacity() {
449
28
            self.try_reserve(1)?;
450
1.05k
        }
451
1.07k
        Ok(self.push(elem))
452
1.07k
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_push
Line
Count
Source
447
65.6k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
65.6k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
65.6k
        }
451
65.6k
        Ok(self.push(elem))
452
65.6k
    }
<alloc::vec::Vec<mp4parse::FLACMetadataBlock> as fallible_collections::vec::FallibleVec<mp4parse::FLACMetadataBlock>>::try_push
Line
Count
Source
447
429k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
429k
        if self.len() == self.capacity() {
449
392
            self.try_reserve(1)?;
450
429k
        }
451
429k
        Ok(self.push(elem))
452
429k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_push
Line
Count
Source
447
5.99k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
5.99k
        if self.len() == self.capacity() {
449
395
            self.try_reserve(1)?;
450
5.59k
        }
451
5.99k
        Ok(self.push(elem))
452
5.99k
    }
<alloc::vec::Vec<mp4parse::ProtectionSchemeInfoBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSchemeInfoBox>>::try_push
Line
Count
Source
447
35.7k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
35.7k
        if self.len() == self.capacity() {
449
4.54k
            self.try_reserve(1)?;
450
31.2k
        }
451
35.7k
        Ok(self.push(elem))
452
35.7k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_push
Line
Count
Source
447
42.4k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
42.4k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
42.4k
        }
451
42.4k
        Ok(self.push(elem))
452
42.4k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_push
Line
Count
Source
447
1.23k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
1.23k
        if self.len() == self.capacity() {
449
295
            self.try_reserve(1)?;
450
941
        }
451
1.23k
        Ok(self.push(elem))
452
1.23k
    }
<alloc::vec::Vec<mp4parse::ProtectionSystemSpecificHeaderBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::try_push
Line
Count
Source
447
5.56k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
5.56k
        if self.len() == self.capacity() {
449
437
            self.try_reserve(1)?;
450
5.12k
        }
451
5.56k
        Ok(self.push(elem))
452
5.56k
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_push
Line
Count
Source
447
216k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
216k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
216k
        }
451
216k
        Ok(self.push(elem))
452
216k
    }
<alloc::vec::Vec<mp4parse::Track> as fallible_collections::vec::FallibleVec<mp4parse::Track>>::try_push
Line
Count
Source
447
41.5k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
41.5k
        if self.len() == self.capacity() {
449
2.28k
            self.try_reserve(1)?;
450
39.2k
        }
451
41.5k
        Ok(self.push(elem))
452
41.5k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_push
Line
Count
Source
447
1.11M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
1.11M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
1.11M
        }
451
1.11M
        Ok(self.push(elem))
452
1.11M
    }
<alloc::vec::Vec<mp4parse::ItemId> as fallible_collections::vec::FallibleVec<mp4parse::ItemId>>::try_push
Line
Count
Source
447
656
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
656
        if self.len() == self.capacity() {
449
236
            self.try_reserve(1)?;
450
420
        }
451
656
        Ok(self.push(elem))
452
656
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_push
Line
Count
Source
447
28.6k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
28.6k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
28.6k
        }
451
28.6k
        Ok(self.push(elem))
452
28.6k
    }
<alloc::vec::Vec<mp4parse::DataBox> as fallible_collections::vec::FallibleVec<mp4parse::DataBox>>::try_push
Line
Count
Source
447
79.5k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
79.5k
        if self.len() == self.capacity() {
449
642
            self.try_reserve(1)?;
450
78.8k
        }
451
79.5k
        Ok(self.push(elem))
452
79.5k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_push
Line
Count
Source
447
12.0k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
12.0k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
12.0k
        }
451
12.0k
        Ok(self.push(elem))
452
12.0k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_push
Line
Count
Source
447
6.81k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
6.81k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
6.81k
        }
451
6.81k
        Ok(self.push(elem))
452
6.81k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_push
Line
Count
Source
447
327k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
327k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
327k
        }
451
327k
        Ok(self.push(elem))
452
327k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_push
Line
Count
Source
447
253
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
253
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
253
        }
451
253
        Ok(self.push(elem))
452
253
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_push
Line
Count
Source
447
210k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
210k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
210k
        }
451
210k
        Ok(self.push(elem))
452
210k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_push
Line
Count
Source
447
281k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
281k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
281k
        }
451
281k
        Ok(self.push(elem))
452
281k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_push
Line
Count
Source
447
107M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
107M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
107M
        }
451
107M
        Ok(self.push(elem))
452
107M
    }
<alloc::vec::Vec<&mp4parse::ItemProperty> as fallible_collections::vec::FallibleVec<&mp4parse::ItemProperty>>::try_push
Line
Count
Source
447
536
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
536
        if self.len() == self.capacity() {
449
517
            self.try_reserve(1)?;
450
19
        }
451
536
        Ok(self.push(elem))
452
536
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_push
Line
Count
Source
447
107M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
107M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
107M
        }
451
107M
        Ok(self.push(elem))
452
107M
    }
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
173k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
173k
    where
467
173k
        Self: core::marker::Sized,
468
    {
469
173k
        let mut n = Self::new();
470
173k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
173k
        Ok(n)
472
173k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_with_capacity
Line
Count
Source
465
1.60k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
1.60k
    where
467
1.60k
        Self: core::marker::Sized,
468
    {
469
1.60k
        let mut n = Self::new();
470
1.60k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
1.60k
        Ok(n)
472
1.60k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_with_capacity
Line
Count
Source
465
625
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
625
    where
467
625
        Self: core::marker::Sized,
468
    {
469
625
        let mut n = Self::new();
470
625
        FallibleVec::try_reserve(&mut n, capacity)?;
471
625
        Ok(n)
472
625
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_with_capacity
Line
Count
Source
465
33.7k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
33.7k
    where
467
33.7k
        Self: core::marker::Sized,
468
    {
469
33.7k
        let mut n = Self::new();
470
33.7k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
33.7k
        Ok(n)
472
33.7k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_with_capacity
Line
Count
Source
465
170
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
170
    where
467
170
        Self: core::marker::Sized,
468
    {
469
170
        let mut n = Self::new();
470
170
        FallibleVec::try_reserve(&mut n, capacity)?;
471
170
        Ok(n)
472
170
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_with_capacity
Line
Count
Source
465
30.3k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
30.3k
    where
467
30.3k
        Self: core::marker::Sized,
468
    {
469
30.3k
        let mut n = Self::new();
470
30.3k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
30.3k
        Ok(n)
472
30.3k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_with_capacity
Line
Count
Source
465
3.85k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
3.85k
    where
467
3.85k
        Self: core::marker::Sized,
468
    {
469
3.85k
        let mut n = Self::new();
470
3.85k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
3.85k
        Ok(n)
472
3.85k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_with_capacity
Line
Count
Source
465
252
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
252
    where
467
252
        Self: core::marker::Sized,
468
    {
469
252
        let mut n = Self::new();
470
252
        FallibleVec::try_reserve(&mut n, capacity)?;
471
252
        Ok(n)
472
252
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_with_capacity
Line
Count
Source
465
11.3k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
11.3k
    where
467
11.3k
        Self: core::marker::Sized,
468
    {
469
11.3k
        let mut n = Self::new();
470
11.3k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
11.3k
        Ok(n)
472
11.3k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_with_capacity
Line
Count
Source
465
1.40k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
1.40k
    where
467
1.40k
        Self: core::marker::Sized,
468
    {
469
1.40k
        let mut n = Self::new();
470
1.40k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
1.40k
        Ok(n)
472
1.40k
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_with_capacity
Line
Count
Source
465
21.9k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
21.9k
    where
467
21.9k
        Self: core::marker::Sized,
468
    {
469
21.9k
        let mut n = Self::new();
470
21.9k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
21.9k
        Ok(n)
472
21.9k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_with_capacity
Line
Count
Source
465
13.1k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
13.1k
    where
467
13.1k
        Self: core::marker::Sized,
468
    {
469
13.1k
        let mut n = Self::new();
470
13.1k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
13.1k
        Ok(n)
472
13.1k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_with_capacity
Line
Count
Source
465
6.33k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
6.33k
    where
467
6.33k
        Self: core::marker::Sized,
468
    {
469
6.33k
        let mut n = Self::new();
470
6.33k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
6.33k
        Ok(n)
472
6.33k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_with_capacity
Line
Count
Source
465
8.10k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
8.10k
    where
467
8.10k
        Self: core::marker::Sized,
468
    {
469
8.10k
        let mut n = Self::new();
470
8.10k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
8.10k
        Ok(n)
472
8.10k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_with_capacity
Line
Count
Source
465
288
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
288
    where
467
288
        Self: core::marker::Sized,
468
    {
469
288
        let mut n = Self::new();
470
288
        FallibleVec::try_reserve(&mut n, capacity)?;
471
288
        Ok(n)
472
288
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_with_capacity
Line
Count
Source
465
10.6k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
10.6k
    where
467
10.6k
        Self: core::marker::Sized,
468
    {
469
10.6k
        let mut n = Self::new();
470
10.6k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
10.6k
        Ok(n)
472
10.6k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_with_capacity
Line
Count
Source
465
28.8k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
28.8k
    where
467
28.8k
        Self: core::marker::Sized,
468
    {
469
28.8k
        let mut n = Self::new();
470
28.8k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
28.8k
        Ok(n)
472
28.8k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_with_capacity
Line
Count
Source
465
417
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
417
    where
467
417
        Self: core::marker::Sized,
468
    {
469
417
        let mut n = Self::new();
470
417
        FallibleVec::try_reserve(&mut n, capacity)?;
471
415
        Ok(n)
472
417
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_with_capacity
Line
Count
Source
465
72
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
72
    where
467
72
        Self: core::marker::Sized,
468
    {
469
72
        let mut n = Self::new();
470
72
        FallibleVec::try_reserve(&mut n, capacity)?;
471
72
        Ok(n)
472
72
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_with_capacity
Line
Count
Source
465
902
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
902
    where
467
902
        Self: core::marker::Sized,
468
    {
469
902
        let mut n = Self::new();
470
902
        FallibleVec::try_reserve(&mut n, capacity)?;
471
902
        Ok(n)
472
902
    }
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
5.56k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
5.56k
        FallibleVec::try_reserve(self, other.len())?;
487
5.56k
        Ok(self.append(other))
488
5.56k
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_append
Line
Count
Source
485
5.56k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
5.56k
        FallibleVec::try_reserve(self, other.len())?;
487
5.56k
        Ok(self.append(other))
488
5.56k
    }
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
115k
    fn try_extend_from_slice_no_copy(&mut self, other: &[T]) -> Result<(), TryReserveError>
537
115k
    where
538
115k
        T: TryClone,
539
    {
540
115k
        if needs_to_grow(self, other.len()) {
541
58.0k
            self.try_reserve(other.len())?;
542
57.3k
        }
543
115k
        let mut len = self.len();
544
115k
        let mut iterator = other.iter();
545
6.20M
        while let Some(element) = iterator.next() {
546
            unsafe {
547
6.08M
                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
6.08M
                len += 1;
550
6.08M
                self.set_len(len);
551
            }
552
        }
553
115k
        Ok(())
554
115k
    }
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
}