Coverage Report

Created: 2026-09-28 07:15

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/fallible_collections-0.5.2/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
63.8k
    fn default() -> Self {
75
63.8k
        Self {
76
63.8k
            inner: Default::default(),
77
63.8k
        }
78
63.8k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseItemExtent> as core::default::Default>::default
Line
Count
Source
74
876
    fn default() -> Self {
75
876
        Self {
76
876
            inner: Default::default(),
77
876
        }
78
876
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::default::Default>::default
Line
Count
Source
74
1.10k
    fn default() -> Self {
75
1.10k
        Self {
76
1.10k
            inner: Default::default(),
77
1.10k
        }
78
1.10k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::default::Default>::default
Line
Count
Source
74
9.08k
    fn default() -> Self {
75
9.08k
        Self {
76
9.08k
            inner: Default::default(),
77
9.08k
        }
78
9.08k
    }
<fallible_collections::vec::TryVec<mp4parse::Track> as core::default::Default>::default
Line
Count
Source
74
9.08k
    fn default() -> Self {
75
9.08k
        Self {
76
9.08k
            inner: Default::default(),
77
9.08k
        }
78
9.08k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::default::Default>::default
Line
Count
Source
74
1.10k
    fn default() -> Self {
75
1.10k
        Self {
76
1.10k
            inner: Default::default(),
77
1.10k
        }
78
1.10k
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox> as core::default::Default>::default
Line
Count
Source
74
438
    fn default() -> Self {
75
438
        Self {
76
438
            inner: Default::default(),
77
438
        }
78
438
    }
<fallible_collections::vec::TryVec<u8> as core::default::Default>::default
Line
Count
Source
74
40.5k
    fn default() -> Self {
75
40.5k
        Self {
76
40.5k
            inner: Default::default(),
77
40.5k
        }
78
40.5k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry> as core::default::Default>::default
Line
Count
Source
74
765
    fn default() -> Self {
75
765
        Self {
76
765
            inner: Default::default(),
77
765
        }
78
765
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox> as core::default::Default>::default
Line
Count
Source
74
803
    fn default() -> Self {
75
803
        Self {
76
803
            inner: Default::default(),
77
803
        }
78
803
    }
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::Extent> 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
746k
    pub fn new() -> Self {
91
746k
        Self { inner: Vec::new() }
92
746k
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
553k
    pub fn new() -> Self {
91
553k
        Self { inner: Vec::new() }
92
553k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::new
Line
Count
Source
90
64.3k
    pub fn new() -> Self {
91
64.3k
        Self { inner: Vec::new() }
92
64.3k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::new
Line
Count
Source
90
153
    pub fn new() -> Self {
91
153
        Self { inner: Vec::new() }
92
153
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::new
Line
Count
Source
90
58.5k
    pub fn new() -> Self {
91
58.5k
        Self { inner: Vec::new() }
92
58.5k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::new
Line
Count
Source
90
998
    pub fn new() -> Self {
91
998
        Self { inner: Vec::new() }
92
998
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::new
Line
Count
Source
90
1.00k
    pub fn new() -> Self {
91
1.00k
        Self { inner: Vec::new() }
92
1.00k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::new
Line
Count
Source
90
191
    pub fn new() -> Self {
91
191
        Self { inner: Vec::new() }
92
191
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::new
Line
Count
Source
90
1.00k
    pub fn new() -> Self {
91
1.00k
        Self { inner: Vec::new() }
92
1.00k
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::new
Line
Count
Source
90
12.5k
    pub fn new() -> Self {
91
12.5k
        Self { inner: Vec::new() }
92
12.5k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::new
Line
Count
Source
90
20.5k
    pub fn new() -> Self {
91
20.5k
        Self { inner: Vec::new() }
92
20.5k
    }
<fallible_collections::vec::TryVec<u32>>::new
Line
Count
Source
90
32.7k
    pub fn new() -> Self {
91
32.7k
        Self { inner: Vec::new() }
92
32.7k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::new
Line
Count
Source
90
1.28k
    pub fn new() -> Self {
91
1.28k
        Self { inner: Vec::new() }
92
1.28k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::new
Line
Count
Source
90
58
    pub fn new() -> Self {
91
58
        Self { inner: Vec::new() }
92
58
    }
<fallible_collections::vec::TryVec<u8>>::new
Line
Count
Source
90
58
    pub fn new() -> Self {
91
58
        Self { inner: Vec::new() }
92
58
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::new
93
94
    #[inline]
95
225k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
225k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
225k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::with_capacity
Line
Count
Source
95
1.50k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
1.50k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
1.50k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::with_capacity
Line
Count
Source
95
2.28k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
2.28k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
2.28k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::with_capacity
Line
Count
Source
95
41.5k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
41.5k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
41.5k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::with_capacity
Line
Count
Source
95
392
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
392
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
392
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::with_capacity
Line
Count
Source
95
33.9k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
33.9k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
33.9k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::with_capacity
Line
Count
Source
95
8.53k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
8.53k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
8.53k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::with_capacity
Line
Count
Source
95
885
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
885
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
885
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::with_capacity
Line
Count
Source
95
11.0k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
11.0k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
11.0k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::with_capacity
Line
Count
Source
95
2.61k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
2.61k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
2.61k
    }
<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::Mp4parseItemExtent>>::with_capacity
Line
Count
Source
95
876
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
876
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
876
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::with_capacity
Line
Count
Source
95
19.7k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
19.7k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
19.7k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::with_capacity
Line
Count
Source
95
5.31k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
5.31k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
5.31k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::with_capacity
Line
Count
Source
95
17.1k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
17.1k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
17.1k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::with_capacity
Line
Count
Source
95
1.00k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
1.00k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
1.00k
    }
<fallible_collections::vec::TryVec<u8>>::with_capacity
Line
Count
Source
95
986
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
986
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
986
    }
<fallible_collections::vec::TryVec<u32>>::with_capacity
Line
Count
Source
95
24.3k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
24.3k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
24.3k
    }
<fallible_collections::vec::TryVec<u64>>::with_capacity
Line
Count
Source
95
31.3k
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
31.3k
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
31.3k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::with_capacity
Line
Count
Source
95
168
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
168
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
168
    }
<fallible_collections::vec::TryVec<usize>>::with_capacity
Line
Count
Source
95
4
    pub fn with_capacity(capacity: usize) -> Result<Self, TryReserveError> {
96
        Ok(Self {
97
4
            inner: FallibleVec::try_with_capacity(capacity)?,
98
        })
99
4
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::with_capacity
100
101
    #[inline(always)]
102
3.97k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
3.97k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
3.97k
    }
<fallible_collections::vec::TryVec<u8>>::append
Line
Count
Source
102
3.97k
    pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
103
3.97k
        FallibleVec::try_append(&mut self.inner, &mut other.inner)
104
3.97k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::append
105
106
    #[inline(always)]
107
159
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
159
        self
109
159
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::as_mut_slice
Line
Count
Source
107
159
    pub fn as_mut_slice(&mut self) -> &mut [T] {
108
159
        self
109
159
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_mut_slice
110
111
    #[inline(always)]
112
80.0k
    pub fn as_slice(&self) -> &[T] {
113
80.0k
        self
114
80.0k
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
77.9k
    pub fn as_slice(&self) -> &[T] {
113
77.9k
        self
114
77.9k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::as_slice
Line
Count
Source
112
336
    pub fn as_slice(&self) -> &[T] {
113
336
        self
114
336
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::as_slice
Line
Count
Source
112
159
    pub fn as_slice(&self) -> &[T] {
113
159
        self
114
159
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::as_slice
Line
Count
Source
112
4
    pub fn as_slice(&self) -> &[T] {
113
4
        self
114
4
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::as_slice
Line
Count
Source
112
87
    pub fn as_slice(&self) -> &[T] {
113
87
        self
114
87
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::as_slice
Line
Count
Source
112
1.28k
    pub fn as_slice(&self) -> &[T] {
113
1.28k
        self
114
1.28k
    }
<fallible_collections::vec::TryVec<u8>>::as_slice
Line
Count
Source
112
208
    pub fn as_slice(&self) -> &[T] {
113
208
        self
114
208
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::as_slice
115
116
    #[inline(always)]
117
0
    pub fn clear(&mut self) {
118
0
        self.inner.clear()
119
0
    }
120
121
    #[cfg(test)]
122
    pub fn into_inner(self) -> Vec<T> {
123
        self.inner
124
    }
125
126
    #[inline(always)]
127
102k
    pub fn is_empty(&self) -> bool {
128
102k
        self.inner.is_empty()
129
102k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::is_empty
Line
Count
Source
127
25.0k
    pub fn is_empty(&self) -> bool {
128
25.0k
        self.inner.is_empty()
129
25.0k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::is_empty
Line
Count
Source
127
18.3k
    pub fn is_empty(&self) -> bool {
128
18.3k
        self.inner.is_empty()
129
18.3k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::is_empty
Line
Count
Source
127
4.62k
    pub fn is_empty(&self) -> bool {
128
4.62k
        self.inner.is_empty()
129
4.62k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::is_empty
Line
Count
Source
127
1.18k
    pub fn is_empty(&self) -> bool {
128
1.18k
        self.inner.is_empty()
129
1.18k
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::is_empty
Line
Count
Source
127
102
    pub fn is_empty(&self) -> bool {
128
102
        self.inner.is_empty()
129
102
    }
<fallible_collections::vec::TryVec<u64>>::is_empty
Line
Count
Source
127
165
    pub fn is_empty(&self) -> bool {
128
165
        self.inner.is_empty()
129
165
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::is_empty
Line
Count
Source
127
11.0k
    pub fn is_empty(&self) -> bool {
128
11.0k
        self.inner.is_empty()
129
11.0k
    }
<fallible_collections::vec::TryVec<u8>>::is_empty
Line
Count
Source
127
2.08k
    pub fn is_empty(&self) -> bool {
128
2.08k
        self.inner.is_empty()
129
2.08k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::is_empty
Line
Count
Source
127
159
    pub fn is_empty(&self) -> bool {
128
159
        self.inner.is_empty()
129
159
    }
<fallible_collections::vec::TryVec<u8>>::is_empty
Line
Count
Source
127
39.7k
    pub fn is_empty(&self) -> bool {
128
39.7k
        self.inner.is_empty()
129
39.7k
    }
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
118k
    pub fn iter(&self) -> Iter<T> {
140
118k
        Iter {
141
118k
            inner: self.inner.iter(),
142
118k
        }
143
118k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::iter
Line
Count
Source
139
30.3k
    pub fn iter(&self) -> Iter<T> {
140
30.3k
        Iter {
141
30.3k
            inner: self.inner.iter(),
142
30.3k
        }
143
30.3k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::iter
Line
Count
Source
139
24.2k
    pub fn iter(&self) -> Iter<T> {
140
24.2k
        Iter {
141
24.2k
            inner: self.inner.iter(),
142
24.2k
        }
143
24.2k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::iter
Line
Count
Source
139
59.1k
    pub fn iter(&self) -> Iter<T> {
140
59.1k
        Iter {
141
59.1k
            inner: self.inner.iter(),
142
59.1k
        }
143
59.1k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::iter
Line
Count
Source
139
202
    pub fn iter(&self) -> Iter<T> {
140
202
        Iter {
141
202
            inner: self.inner.iter(),
142
202
        }
143
202
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::iter
Line
Count
Source
139
212
    pub fn iter(&self) -> Iter<T> {
140
212
        Iter {
141
212
            inner: self.inner.iter(),
142
212
        }
143
212
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::iter
Line
Count
Source
139
794
    pub fn iter(&self) -> Iter<T> {
140
794
        Iter {
141
794
            inner: self.inner.iter(),
142
794
        }
143
794
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::iter
Line
Count
Source
139
1.64k
    pub fn iter(&self) -> Iter<T> {
140
1.64k
        Iter {
141
1.64k
            inner: self.inner.iter(),
142
1.64k
        }
143
1.64k
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::iter
Line
Count
Source
139
572
    pub fn iter(&self) -> Iter<T> {
140
572
        Iter {
141
572
            inner: self.inner.iter(),
142
572
        }
143
572
    }
<fallible_collections::vec::TryVec<u8>>::iter
Line
Count
Source
139
1.41k
    pub fn iter(&self) -> Iter<T> {
140
1.41k
        Iter {
141
1.41k
            inner: self.inner.iter(),
142
1.41k
        }
143
1.41k
    }
<fallible_collections::vec::TryVec<u32>>::iter
Line
Count
Source
139
168
    pub fn iter(&self) -> Iter<T> {
140
168
        Iter {
141
168
            inner: self.inner.iter(),
142
168
        }
143
168
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::iter
Line
Count
Source
139
199
    pub fn iter(&self) -> Iter<T> {
140
199
        Iter {
141
199
            inner: self.inner.iter(),
142
199
        }
143
199
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::iter
144
145
    #[inline(always)]
146
43.6k
    pub fn pop(&mut self) -> Option<T> {
147
43.6k
        self.inner.pop()
148
43.6k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::pop
Line
Count
Source
146
43.6k
    pub fn pop(&mut self) -> Option<T> {
147
43.6k
        self.inner.pop()
148
43.6k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::pop
149
150
    #[inline(always)]
151
2.80M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
2.80M
        FallibleVec::try_push(&mut self.inner, value)
153
2.80M
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseItemExtent>>::push
Line
Count
Source
151
89
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
89
        FallibleVec::try_push(&mut self.inner, value)
153
89
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::push
Line
Count
Source
151
18.3k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
18.3k
        FallibleVec::try_push(&mut self.inner, value)
153
18.3k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::push
Line
Count
Source
151
5.88k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
5.88k
        FallibleVec::try_push(&mut self.inner, value)
153
5.88k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::push
Line
Count
Source
151
192k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
192k
        FallibleVec::try_push(&mut self.inner, value)
153
192k
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset>>::push
Line
Count
Source
151
142k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
142k
        FallibleVec::try_push(&mut self.inner, value)
153
142k
    }
<fallible_collections::vec::TryVec<mp4parse::Association>>::push
Line
Count
Source
151
11.0k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
11.0k
        FallibleVec::try_push(&mut self.inner, value)
153
11.0k
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry>>::push
Line
Count
Source
151
102k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
102k
        FallibleVec::try_push(&mut self.inner, value)
153
102k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemInfoEntry>>::push
Line
Count
Source
151
903
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
903
        FallibleVec::try_push(&mut self.inner, value)
153
903
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk>>::push
Line
Count
Source
151
30.4k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
30.4k
        FallibleVec::try_push(&mut self.inner, value)
153
30.4k
    }
<fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock>>::push
Line
Count
Source
151
4.18k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
4.18k
        FallibleVec::try_push(&mut self.inner, value)
153
4.18k
    }
<fallible_collections::vec::TryVec<mp4parse::TrackReferenceEntry>>::push
Line
Count
Source
151
17.9k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
17.9k
        FallibleVec::try_push(&mut self.inner, value)
153
17.9k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSchemeInfoBox>>::push
Line
Count
Source
151
10.1k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
10.1k
        FallibleVec::try_push(&mut self.inner, value)
153
10.1k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::push
Line
Count
Source
151
55.2k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
55.2k
        FallibleVec::try_push(&mut self.inner, value)
153
55.2k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry>>::push
Line
Count
Source
151
3.72k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
3.72k
        FallibleVec::try_push(&mut self.inner, value)
153
3.72k
    }
<fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::push
Line
Count
Source
151
3.97k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
3.97k
        FallibleVec::try_push(&mut self.inner, value)
153
3.97k
    }
<fallible_collections::vec::TryVec<mp4parse::Edit>>::push
Line
Count
Source
151
138k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
138k
        FallibleVec::try_push(&mut self.inner, value)
153
138k
    }
<fallible_collections::vec::TryVec<mp4parse::Track>>::push
Line
Count
Source
151
47.5k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
47.5k
        FallibleVec::try_push(&mut self.inner, value)
153
47.5k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent>>::push
Line
Count
Source
151
1.02M
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
1.02M
        FallibleVec::try_push(&mut self.inner, value)
153
1.02M
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId>>::push
Line
Count
Source
151
2.15k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
2.15k
        FallibleVec::try_push(&mut self.inner, value)
153
2.15k
    }
<fallible_collections::vec::TryVec<mp4parse::Sample>>::push
Line
Count
Source
151
21.0k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
21.0k
        FallibleVec::try_push(&mut self.inner, value)
153
21.0k
    }
<fallible_collections::vec::TryVec<mp4parse::DataBox>>::push
Line
Count
Source
151
196k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
196k
        FallibleVec::try_push(&mut self.inner, value)
153
196k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC>>::push
Line
Count
Source
151
499k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
499k
        FallibleVec::try_push(&mut self.inner, value)
153
499k
    }
<fallible_collections::vec::TryVec<(u8, u32)>>::push
Line
Count
Source
151
994
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
994
        FallibleVec::try_push(&mut self.inner, value)
153
994
    }
<fallible_collections::vec::TryVec<u32>>::push
Line
Count
Source
151
102k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
102k
        FallibleVec::try_push(&mut self.inner, value)
153
102k
    }
<fallible_collections::vec::TryVec<u64>>::push
Line
Count
Source
151
163k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
163k
        FallibleVec::try_push(&mut self.inner, value)
153
163k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty>>::push
Line
Count
Source
151
721
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
721
        FallibleVec::try_push(&mut self.inner, value)
153
721
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice>>::push
Line
Count
Source
151
5.57k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
5.57k
        FallibleVec::try_push(&mut self.inner, value)
153
5.57k
    }
<fallible_collections::vec::TryVec<usize>>::push
Line
Count
Source
151
5.57k
    pub fn push(&mut self, value: T) -> Result<(), TryReserveError> {
152
5.57k
        FallibleVec::try_push(&mut self.inner, value)
153
5.57k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_>>::push
154
155
    #[inline(always)]
156
556k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
556k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
556k
    }
<fallible_collections::vec::TryVec<fallible_collections::vec::TryVec<u8>>>::reserve
Line
Count
Source
156
1.38k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
1.38k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
1.38k
    }
<fallible_collections::vec::TryVec<mp4parse::SingleItemTypeReferenceBox>>::reserve
Line
Count
Source
156
1.88k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
1.88k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
1.88k
    }
<fallible_collections::vec::TryVec<u32>>::reserve
Line
Count
Source
156
22.8k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
22.8k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
22.8k
    }
<fallible_collections::vec::TryVec<u8>>::reserve
Line
Count
Source
156
530k
    pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
157
530k
        FallibleVec::try_reserve(&mut self.inner, additional)
158
530k
    }
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
143k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
143k
        self.inner.try_extend_from_slice_no_copy(other)
191
143k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
4.26k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
4.26k
        self.inner.try_extend_from_slice_no_copy(other)
191
4.26k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
8.80k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
8.80k
        self.inner.try_extend_from_slice_no_copy(other)
191
8.80k
    }
<fallible_collections::vec::TryVec<u8>>::extend_from_slice
Line
Count
Source
189
130k
    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> {
190
130k
        self.inner.try_extend_from_slice_no_copy(other)
191
130k
    }
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
741
    fn into_iter(self) -> Self::IntoIter {
200
741
        self.inner.into_iter()
201
741
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
199
741
    fn into_iter(self) -> Self::IntoIter {
200
741
        self.inner.into_iter()
201
741
    }
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
40.3k
    fn into_iter(self) -> Self::IntoIter {
210
40.3k
        self.inner.iter()
211
40.3k
    }
<&fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
143
    fn into_iter(self) -> Self::IntoIter {
210
143
        self.inner.iter()
211
143
    }
<&fallible_collections::vec::TryVec<mp4parse::ProtectionSystemSpecificHeaderBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
91
    fn into_iter(self) -> Self::IntoIter {
210
91
        self.inner.iter()
211
91
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
1.63k
    fn into_iter(self) -> Self::IntoIter {
210
1.63k
        self.inner.iter()
211
1.63k
    }
<&fallible_collections::vec::TryVec<mp4parse::Track> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
33.9k
    fn into_iter(self) -> Self::IntoIter {
210
33.9k
        self.inner.iter()
211
33.9k
    }
<&fallible_collections::vec::TryVec<mp4parse::Extent> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
778
    fn into_iter(self) -> Self::IntoIter {
210
778
        self.inner.iter()
211
778
    }
<&fallible_collections::vec::TryVec<mp4parse::Association> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
2.31k
    fn into_iter(self) -> Self::IntoIter {
210
2.31k
        self.inner.iter()
211
2.31k
    }
<&fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
1.28k
    fn into_iter(self) -> Self::IntoIter {
210
1.28k
        self.inner.iter()
211
1.28k
    }
<&fallible_collections::vec::TryVec<u32> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
6
    fn into_iter(self) -> Self::IntoIter {
210
6
        self.inner.iter()
211
6
    }
<&fallible_collections::vec::TryVec<mp4parse::DataBox> as core::iter::traits::collect::IntoIterator>::into_iter
Line
Count
Source
209
87
    fn into_iter(self) -> Self::IntoIter {
210
87
        self.inner.iter()
211
87
    }
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
527k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
527k
            let mut buf = TryVec::new();
225
527k
            self.try_read_to_end(&mut buf)?;
226
527k
            Ok(buf)
227
527k
        }
<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
1.04k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.04k
            let mut buf = TryVec::new();
225
1.04k
            self.try_read_to_end(&mut buf)?;
226
930
            Ok(buf)
227
1.04k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
4.56k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.56k
            let mut buf = TryVec::new();
225
4.56k
            self.try_read_to_end(&mut buf)?;
226
4.56k
            Ok(buf)
227
4.56k
        }
<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
41.3k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
41.3k
            let mut buf = TryVec::new();
225
41.3k
            self.try_read_to_end(&mut buf)?;
226
41.1k
            Ok(buf)
227
41.3k
        }
<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
1.16k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.16k
            let mut buf = TryVec::new();
225
1.16k
            self.try_read_to_end(&mut buf)?;
226
1.16k
            Ok(buf)
227
1.16k
        }
<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
8.04k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
8.04k
            let mut buf = TryVec::new();
225
8.04k
            self.try_read_to_end(&mut buf)?;
226
8.04k
            Ok(buf)
227
8.04k
        }
<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
1.26k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.26k
            let mut buf = TryVec::new();
225
1.26k
            self.try_read_to_end(&mut buf)?;
226
1.26k
            Ok(buf)
227
1.26k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
11.8k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
11.8k
            let mut buf = TryVec::new();
225
11.8k
            self.try_read_to_end(&mut buf)?;
226
11.7k
            Ok(buf)
227
11.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
10
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
10
            let mut buf = TryVec::new();
225
10
            self.try_read_to_end(&mut buf)?;
226
10
            Ok(buf)
227
10
        }
<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
11.9k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
11.9k
            let mut buf = TryVec::new();
225
11.9k
            self.try_read_to_end(&mut buf)?;
226
11.8k
            Ok(buf)
227
11.9k
        }
<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
1.82k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
1.82k
            let mut buf = TryVec::new();
225
1.82k
            self.try_read_to_end(&mut buf)?;
226
1.82k
            Ok(buf)
227
1.82k
        }
<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
11.1k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
11.1k
            let mut buf = TryVec::new();
225
11.1k
            self.try_read_to_end(&mut buf)?;
226
11.1k
            Ok(buf)
227
11.1k
        }
<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.82k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
3.82k
            let mut buf = TryVec::new();
225
3.82k
            self.try_read_to_end(&mut buf)?;
226
3.82k
            Ok(buf)
227
3.82k
        }
<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
316
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
316
            let mut buf = TryVec::new();
225
316
            self.try_read_to_end(&mut buf)?;
226
316
            Ok(buf)
227
316
        }
<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
162k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
162k
            let mut buf = TryVec::new();
225
162k
            self.try_read_to_end(&mut buf)?;
226
162k
            Ok(buf)
227
162k
        }
<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
6.69k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
6.69k
            let mut buf = TryVec::new();
225
6.69k
            self.try_read_to_end(&mut buf)?;
226
6.69k
            Ok(buf)
227
6.69k
        }
<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.36k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.36k
            let mut buf = TryVec::new();
225
4.36k
            self.try_read_to_end(&mut buf)?;
226
4.36k
            Ok(buf)
227
4.36k
        }
<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
21.7k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
21.7k
            let mut buf = TryVec::new();
225
21.7k
            self.try_read_to_end(&mut buf)?;
226
21.7k
            Ok(buf)
227
21.7k
        }
<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
33.5k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
33.5k
            let mut buf = TryVec::new();
225
33.5k
            self.try_read_to_end(&mut buf)?;
226
33.5k
            Ok(buf)
227
33.5k
        }
<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
4.51k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
4.51k
            let mut buf = TryVec::new();
225
4.51k
            self.try_read_to_end(&mut buf)?;
226
4.51k
            Ok(buf)
227
4.51k
        }
<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>> as fallible_collections::vec::std_io::TryRead>::read_into_try_vec
Line
Count
Source
223
196k
        fn read_into_try_vec(&mut self) -> io::Result<TryVec<u8>> {
224
196k
            let mut buf = TryVec::new();
225
196k
            self.try_read_to_end(&mut buf)?;
226
196k
            Ok(buf)
227
196k
        }
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
260k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
260k
            try_read_up_to(self, self.limit(), buf)
246
260k
        }
<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
1.04k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.04k
            try_read_up_to(self, self.limit(), buf)
246
1.04k
        }
<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
4.56k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
4.56k
            try_read_up_to(self, self.limit(), buf)
246
4.56k
        }
<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
41.3k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
41.3k
            try_read_up_to(self, self.limit(), buf)
246
41.3k
        }
<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
1.16k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.16k
            try_read_up_to(self, self.limit(), buf)
246
1.16k
        }
<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
8.04k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
8.04k
            try_read_up_to(self, self.limit(), buf)
246
8.04k
        }
<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
1.26k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.26k
            try_read_up_to(self, self.limit(), buf)
246
1.26k
        }
<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>> as fallible_collections::vec::std_io::TryRead>::try_read_to_end
Line
Count
Source
244
11.8k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
11.8k
            try_read_up_to(self, self.limit(), buf)
246
11.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
10
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
10
            try_read_up_to(self, self.limit(), buf)
246
10
        }
<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
11.9k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
11.9k
            try_read_up_to(self, self.limit(), buf)
246
11.9k
        }
<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
1.82k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
1.82k
            try_read_up_to(self, self.limit(), buf)
246
1.82k
        }
<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
11.1k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
11.1k
            try_read_up_to(self, self.limit(), buf)
246
11.1k
        }
<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.82k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
3.82k
            try_read_up_to(self, self.limit(), buf)
246
3.82k
        }
<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
316
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
316
            try_read_up_to(self, self.limit(), buf)
246
316
        }
<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
162k
        fn try_read_to_end(&mut self, buf: &mut TryVec<u8>) -> io::Result<usize> {
245
162k
            try_read_up_to(self, self.limit(), buf)
246
162k
        }
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
530k
    pub fn try_read_up_to<R: Read>(
253
530k
        src: &mut R,
254
530k
        limit: u64,
255
530k
        buf: &mut TryVec<u8>,
256
530k
    ) -> io::Result<usize> {
257
530k
        let additional = limit
258
530k
            .try_into()
259
530k
            .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
530k
        buf.reserve(additional)
261
530k
            .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}
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>::{closure#1}
Line
Count
Source
261
40
            .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_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}
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}
Line
Count
Source
261
112
            .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 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
234
            .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 std::io::Take<&mut 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::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}
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}
Line
Count
Source
261
62
            .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_capi::Mp4parseIo>>>>>>>>>>>::{closure#1}
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}
Line
Count
Source
261
58
            .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_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
529k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
529k
        Ok(bytes_read)
264
530k
    }
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
6.69k
    pub fn try_read_up_to<R: Read>(
253
6.69k
        src: &mut R,
254
6.69k
        limit: u64,
255
6.69k
        buf: &mut TryVec<u8>,
256
6.69k
    ) -> io::Result<usize> {
257
6.69k
        let additional = limit
258
6.69k
            .try_into()
259
6.69k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
6.69k
        buf.reserve(additional)
261
6.69k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
6.69k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
6.69k
        Ok(bytes_read)
264
6.69k
    }
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.36k
    pub fn try_read_up_to<R: Read>(
253
4.36k
        src: &mut R,
254
4.36k
        limit: u64,
255
4.36k
        buf: &mut TryVec<u8>,
256
4.36k
    ) -> io::Result<usize> {
257
4.36k
        let additional = limit
258
4.36k
            .try_into()
259
4.36k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.36k
        buf.reserve(additional)
261
4.36k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.36k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.36k
        Ok(bytes_read)
264
4.36k
    }
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
23.9k
    pub fn try_read_up_to<R: Read>(
253
23.9k
        src: &mut R,
254
23.9k
        limit: u64,
255
23.9k
        buf: &mut TryVec<u8>,
256
23.9k
    ) -> io::Result<usize> {
257
23.9k
        let additional = limit
258
23.9k
            .try_into()
259
23.9k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
23.9k
        buf.reserve(additional)
261
23.9k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
23.9k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
23.9k
        Ok(bytes_read)
264
23.9k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>
Line
Count
Source
252
33.5k
    pub fn try_read_up_to<R: Read>(
253
33.5k
        src: &mut R,
254
33.5k
        limit: u64,
255
33.5k
        buf: &mut TryVec<u8>,
256
33.5k
    ) -> io::Result<usize> {
257
33.5k
        let additional = limit
258
33.5k
            .try_into()
259
33.5k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
33.5k
        buf.reserve(additional)
261
33.5k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
33.5k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
33.5k
        Ok(bytes_read)
264
33.5k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
4.51k
    pub fn try_read_up_to<R: Read>(
253
4.51k
        src: &mut R,
254
4.51k
        limit: u64,
255
4.51k
        buf: &mut TryVec<u8>,
256
4.51k
    ) -> io::Result<usize> {
257
4.51k
        let additional = limit
258
4.51k
            .try_into()
259
4.51k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.51k
        buf.reserve(additional)
261
4.51k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.51k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.51k
        Ok(bytes_read)
264
4.51k
    }
fallible_collections::vec::std_io::try_read_up_to::<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>
Line
Count
Source
252
196k
    pub fn try_read_up_to<R: Read>(
253
196k
        src: &mut R,
254
196k
        limit: u64,
255
196k
        buf: &mut TryVec<u8>,
256
196k
    ) -> io::Result<usize> {
257
196k
        let additional = limit
258
196k
            .try_into()
259
196k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
196k
        buf.reserve(additional)
261
196k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
196k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
196k
        Ok(bytes_read)
264
196k
    }
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
1.04k
    pub fn try_read_up_to<R: Read>(
253
1.04k
        src: &mut R,
254
1.04k
        limit: u64,
255
1.04k
        buf: &mut TryVec<u8>,
256
1.04k
    ) -> io::Result<usize> {
257
1.04k
        let additional = limit
258
1.04k
            .try_into()
259
1.04k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.04k
        buf.reserve(additional)
261
1.04k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
930
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
930
        Ok(bytes_read)
264
1.04k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>>>>>>>
Line
Count
Source
252
4.56k
    pub fn try_read_up_to<R: Read>(
253
4.56k
        src: &mut R,
254
4.56k
        limit: u64,
255
4.56k
        buf: &mut TryVec<u8>,
256
4.56k
    ) -> io::Result<usize> {
257
4.56k
        let additional = limit
258
4.56k
            .try_into()
259
4.56k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
4.56k
        buf.reserve(additional)
261
4.56k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
4.56k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
4.56k
        Ok(bytes_read)
264
4.56k
    }
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
41.3k
    pub fn try_read_up_to<R: Read>(
253
41.3k
        src: &mut R,
254
41.3k
        limit: u64,
255
41.3k
        buf: &mut TryVec<u8>,
256
41.3k
    ) -> io::Result<usize> {
257
41.3k
        let additional = limit
258
41.3k
            .try_into()
259
41.3k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
41.3k
        buf.reserve(additional)
261
41.3k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
41.1k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
41.1k
        Ok(bytes_read)
264
41.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_capi::Mp4parseIo>>>>>>>>
Line
Count
Source
252
1.16k
    pub fn try_read_up_to<R: Read>(
253
1.16k
        src: &mut R,
254
1.16k
        limit: u64,
255
1.16k
        buf: &mut TryVec<u8>,
256
1.16k
    ) -> io::Result<usize> {
257
1.16k
        let additional = limit
258
1.16k
            .try_into()
259
1.16k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.16k
        buf.reserve(additional)
261
1.16k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.16k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.16k
        Ok(bytes_read)
264
1.16k
    }
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
8.04k
    pub fn try_read_up_to<R: Read>(
253
8.04k
        src: &mut R,
254
8.04k
        limit: u64,
255
8.04k
        buf: &mut TryVec<u8>,
256
8.04k
    ) -> io::Result<usize> {
257
8.04k
        let additional = limit
258
8.04k
            .try_into()
259
8.04k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
8.04k
        buf.reserve(additional)
261
8.04k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
8.04k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
8.04k
        Ok(bytes_read)
264
8.04k
    }
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
1.26k
    pub fn try_read_up_to<R: Read>(
253
1.26k
        src: &mut R,
254
1.26k
        limit: u64,
255
1.26k
        buf: &mut TryVec<u8>,
256
1.26k
    ) -> io::Result<usize> {
257
1.26k
        let additional = limit
258
1.26k
            .try_into()
259
1.26k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.26k
        buf.reserve(additional)
261
1.26k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.26k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.26k
        Ok(bytes_read)
264
1.26k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>>>>>>>>>>>
Line
Count
Source
252
11.8k
    pub fn try_read_up_to<R: Read>(
253
11.8k
        src: &mut R,
254
11.8k
        limit: u64,
255
11.8k
        buf: &mut TryVec<u8>,
256
11.8k
    ) -> io::Result<usize> {
257
11.8k
        let additional = limit
258
11.8k
            .try_into()
259
11.8k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
11.8k
        buf.reserve(additional)
261
11.8k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
11.7k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
11.7k
        Ok(bytes_read)
264
11.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
10
    pub fn try_read_up_to<R: Read>(
253
10
        src: &mut R,
254
10
        limit: u64,
255
10
        buf: &mut TryVec<u8>,
256
10
    ) -> io::Result<usize> {
257
10
        let additional = limit
258
10
            .try_into()
259
10
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
10
        buf.reserve(additional)
261
10
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
10
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
10
        Ok(bytes_read)
264
10
    }
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
11.9k
    pub fn try_read_up_to<R: Read>(
253
11.9k
        src: &mut R,
254
11.9k
        limit: u64,
255
11.9k
        buf: &mut TryVec<u8>,
256
11.9k
    ) -> io::Result<usize> {
257
11.9k
        let additional = limit
258
11.9k
            .try_into()
259
11.9k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
11.9k
        buf.reserve(additional)
261
11.9k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
11.8k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
11.8k
        Ok(bytes_read)
264
11.9k
    }
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
1.82k
    pub fn try_read_up_to<R: Read>(
253
1.82k
        src: &mut R,
254
1.82k
        limit: u64,
255
1.82k
        buf: &mut TryVec<u8>,
256
1.82k
    ) -> io::Result<usize> {
257
1.82k
        let additional = limit
258
1.82k
            .try_into()
259
1.82k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
1.82k
        buf.reserve(additional)
261
1.82k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
1.82k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
1.82k
        Ok(bytes_read)
264
1.82k
    }
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
11.1k
    pub fn try_read_up_to<R: Read>(
253
11.1k
        src: &mut R,
254
11.1k
        limit: u64,
255
11.1k
        buf: &mut TryVec<u8>,
256
11.1k
    ) -> io::Result<usize> {
257
11.1k
        let additional = limit
258
11.1k
            .try_into()
259
11.1k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
11.1k
        buf.reserve(additional)
261
11.1k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
11.1k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
11.1k
        Ok(bytes_read)
264
11.1k
    }
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.82k
    pub fn try_read_up_to<R: Read>(
253
3.82k
        src: &mut R,
254
3.82k
        limit: u64,
255
3.82k
        buf: &mut TryVec<u8>,
256
3.82k
    ) -> io::Result<usize> {
257
3.82k
        let additional = limit
258
3.82k
            .try_into()
259
3.82k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
3.82k
        buf.reserve(additional)
261
3.82k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
3.82k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
3.82k
        Ok(bytes_read)
264
3.82k
    }
fallible_collections::vec::std_io::try_read_up_to::<std::io::Take<&mut mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::Mp4parseIo>>>>
Line
Count
Source
252
316
    pub fn try_read_up_to<R: Read>(
253
316
        src: &mut R,
254
316
        limit: u64,
255
316
        buf: &mut TryVec<u8>,
256
316
    ) -> io::Result<usize> {
257
316
        let additional = limit
258
316
            .try_into()
259
316
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
316
        buf.reserve(additional)
261
316
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
316
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
316
        Ok(bytes_read)
264
316
    }
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
162k
    pub fn try_read_up_to<R: Read>(
253
162k
        src: &mut R,
254
162k
        limit: u64,
255
162k
        buf: &mut TryVec<u8>,
256
162k
    ) -> io::Result<usize> {
257
162k
        let additional = limit
258
162k
            .try_into()
259
162k
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
162k
        buf.reserve(additional)
261
162k
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
162k
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
162k
        Ok(bytes_read)
264
162k
    }
fallible_collections::vec::std_io::try_read_up_to::<&mut mp4parse::OffsetReader<mp4parse_capi::Mp4parseIo>>
Line
Count
Source
252
513
    pub fn try_read_up_to<R: Read>(
253
513
        src: &mut R,
254
513
        limit: u64,
255
513
        buf: &mut TryVec<u8>,
256
513
    ) -> io::Result<usize> {
257
513
        let additional = limit
258
513
            .try_into()
259
513
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
260
513
        buf.reserve(additional)
261
513
            .map_err(|_| io::Error::new(io::ErrorKind::Other, "reserve allocation failed"))?;
262
513
        let bytes_read = src.take(limit).read_to_end(&mut buf.inner)?;
263
513
        Ok(bytes_read)
264
513
    }
Unexecuted instantiation: fallible_collections::vec::std_io::try_read_up_to::<_>
265
266
    impl Write for TryVec<u8> {
267
130k
        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
268
130k
            self.extend_from_slice(buf)
269
130k
                .map_err(|_| io::Error::new(io::ErrorKind::Other, "extend_from_slice failed"))?;
270
130k
            Ok(buf.len())
271
130k
        }
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
181k
    fn as_ref(&self) -> &[u8] {
350
181k
        self.inner.as_ref()
351
181k
    }
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.75k
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
1.75k
        let mut v = Self::new();
367
1.75k
        v.inner.try_extend_from_slice_no_copy(value)?;
368
1.75k
        Ok(v)
369
1.75k
    }
<fallible_collections::vec::TryVec<u8> as core::convert::TryFrom<&[u8]>>::try_from
Line
Count
Source
365
1.75k
    fn try_from(value: &[T]) -> Result<Self, Self::Error> {
366
1.75k
        let mut v = Self::new();
367
1.75k
        v.inner.try_extend_from_slice_no_copy(value)?;
368
1.75k
        Ok(v)
369
1.75k
    }
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
1.08M
    fn deref(&self) -> &[T] {
388
1.08M
        self.inner.deref()
389
1.08M
    }
<fallible_collections::vec::TryVec<mp4parse::SampleEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
167k
    fn deref(&self) -> &[T] {
388
167k
        self.inner.deref()
389
167k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<mp4parse::FLACMetadataBlock> as core::ops::deref::Deref>::deref
<fallible_collections::vec::TryVec<mp4parse::Track> as core::ops::deref::Deref>::deref
Line
Count
Source
387
201k
    fn deref(&self) -> &[T] {
388
201k
        self.inner.deref()
389
201k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseItemExtent> as core::ops::deref::Deref>::deref
Line
Count
Source
387
870
    fn deref(&self) -> &[T] {
388
870
        self.inner.deref()
389
870
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
54.9k
    fn deref(&self) -> &[T] {
388
54.9k
        self.inner.deref()
389
54.9k
    }
<fallible_collections::vec::TryVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as core::ops::deref::Deref>::deref
Line
Count
Source
387
13.8k
    fn deref(&self) -> &[T] {
388
13.8k
        self.inner.deref()
389
13.8k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
159
    fn deref(&self) -> &[T] {
388
159
        self.inner.deref()
389
159
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
401k
    fn deref(&self) -> &[T] {
388
401k
        self.inner.deref()
389
401k
    }
<fallible_collections::vec::TryVec<mp4parse::ItemPropertyAssociationEntry> as core::ops::deref::Deref>::deref
Line
Count
Source
387
2.55k
    fn deref(&self) -> &[T] {
388
2.55k
        self.inner.deref()
389
2.55k
    }
<fallible_collections::vec::TryVec<mp4parse::Edit> as core::ops::deref::Deref>::deref
Line
Count
Source
387
26.8k
    fn deref(&self) -> &[T] {
388
26.8k
        self.inner.deref()
389
26.8k
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::ops::deref::Deref>::deref
Line
Count
Source
387
784
    fn deref(&self) -> &[T] {
388
784
        self.inner.deref()
389
784
    }
<fallible_collections::vec::TryVec<mp4parse::ItemId> as core::ops::deref::Deref>::deref
Line
Count
Source
387
2.04k
    fn deref(&self) -> &[T] {
388
2.04k
        self.inner.deref()
389
2.04k
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC> as core::ops::deref::Deref>::deref
Line
Count
Source
387
8.39k
    fn deref(&self) -> &[T] {
388
8.39k
        self.inner.deref()
389
8.39k
    }
<fallible_collections::vec::TryVec<(u8, u32)> as core::ops::deref::Deref>::deref
Line
Count
Source
387
997
    fn deref(&self) -> &[T] {
388
997
        self.inner.deref()
389
997
    }
<fallible_collections::vec::TryVec<u32> as core::ops::deref::Deref>::deref
Line
Count
Source
387
126
    fn deref(&self) -> &[T] {
388
126
        self.inner.deref()
389
126
    }
<fallible_collections::vec::TryVec<mp4parse::SampleToChunk> as core::ops::deref::Deref>::deref
Line
Count
Source
387
336
    fn deref(&self) -> &[T] {
388
336
        self.inner.deref()
389
336
    }
<fallible_collections::vec::TryVec<mp4parse::Sample> as core::ops::deref::Deref>::deref
Line
Count
Source
387
159
    fn deref(&self) -> &[T] {
388
159
        self.inner.deref()
389
159
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::Deref>::deref
Line
Count
Source
387
25.2k
    fn deref(&self) -> &[T] {
388
25.2k
        self.inner.deref()
389
25.2k
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::Deref>::deref
Line
Count
Source
387
4
    fn deref(&self) -> &[T] {
388
4
        self.inner.deref()
389
4
    }
<fallible_collections::vec::TryVec<u64> as core::ops::deref::Deref>::deref
Line
Count
Source
387
722
    fn deref(&self) -> &[T] {
388
722
        self.inner.deref()
389
722
    }
<fallible_collections::vec::TryVec<mp4parse::TimeOffset> as core::ops::deref::Deref>::deref
Line
Count
Source
387
4
    fn deref(&self) -> &[T] {
388
4
        self.inner.deref()
389
4
    }
<fallible_collections::vec::TryVec<mp4parse::Extent> as core::ops::deref::Deref>::deref
Line
Count
Source
387
87
    fn deref(&self) -> &[T] {
388
87
        self.inner.deref()
389
87
    }
<fallible_collections::vec::TryVec<mp4parse::boxes::FourCC> as core::ops::deref::Deref>::deref
Line
Count
Source
387
50.2k
    fn deref(&self) -> &[T] {
388
50.2k
        self.inner.deref()
389
50.2k
    }
<fallible_collections::vec::TryVec<&mp4parse::ItemProperty> as core::ops::deref::Deref>::deref
Line
Count
Source
387
1.29k
    fn deref(&self) -> &[T] {
388
1.29k
        self.inner.deref()
389
1.29k
    }
<fallible_collections::vec::TryVec<u8> as core::ops::deref::Deref>::deref
Line
Count
Source
387
128k
    fn deref(&self) -> &[T] {
388
128k
        self.inner.deref()
389
128k
    }
Unexecuted instantiation: <fallible_collections::vec::TryVec<_> as core::ops::deref::Deref>::deref
390
}
391
392
impl<T> core::ops::DerefMut for TryVec<T> {
393
5.85k
    fn deref_mut(&mut self) -> &mut [T] {
394
5.85k
        self.inner.deref_mut()
395
5.85k
    }
<fallible_collections::vec::TryVec<mp4parse::unstable::Indice> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
5.84k
    fn deref_mut(&mut self) -> &mut [T] {
394
5.84k
        self.inner.deref_mut()
395
5.84k
    }
<fallible_collections::vec::TryVec<usize> as core::ops::deref::DerefMut>::deref_mut
Line
Count
Source
393
4
    fn deref_mut(&mut self) -> &mut [T] {
394
4
        self.inner.deref_mut()
395
4
    }
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
34.2M
    fn next(&mut self) -> Option<Self::Item> {
407
34.2M
        self.inner.next()
408
34.2M
    }
<fallible_collections::vec::Iter<mp4parse::SampleEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
61.4k
    fn next(&mut self) -> Option<Self::Item> {
407
61.4k
        self.inner.next()
408
61.4k
    }
<fallible_collections::vec::Iter<mp4parse::ItemInfoEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
287
    fn next(&mut self) -> Option<Self::Item> {
407
287
        self.inner.next()
408
287
    }
<fallible_collections::vec::Iter<mp4parse::SampleToChunk> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
257
    fn next(&mut self) -> Option<Self::Item> {
407
257
        self.inner.next()
408
257
    }
<fallible_collections::vec::Iter<mp4parse::ProtectionSchemeInfoBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
25.4k
    fn next(&mut self) -> Option<Self::Item> {
407
25.4k
        self.inner.next()
408
25.4k
    }
<fallible_collections::vec::Iter<mp4parse::SingleItemTypeReferenceBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
1.96k
    fn next(&mut self) -> Option<Self::Item> {
407
1.96k
        self.inner.next()
408
1.96k
    }
<fallible_collections::vec::Iter<mp4parse::ItemPropertyAssociationEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
9.01k
    fn next(&mut self) -> Option<Self::Item> {
407
9.01k
        self.inner.next()
408
9.01k
    }
<fallible_collections::vec::Iter<mp4parse::Track> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
33.9M
    fn next(&mut self) -> Option<Self::Item> {
407
33.9M
        self.inner.next()
408
33.9M
    }
<fallible_collections::vec::Iter<u8> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
14.5k
    fn next(&mut self) -> Option<Self::Item> {
407
14.5k
        self.inner.next()
408
14.5k
    }
<fallible_collections::vec::Iter<mp4parse::DataBox> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
128k
    fn next(&mut self) -> Option<Self::Item> {
407
128k
        self.inner.next()
408
128k
    }
<fallible_collections::vec::Iter<u32> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
5.57k
    fn next(&mut self) -> Option<Self::Item> {
407
5.57k
        self.inner.next()
408
5.57k
    }
<fallible_collections::vec::Iter<mp4parse::TrackReferenceEntry> as core::iter::traits::iterator::Iterator>::next
Line
Count
Source
406
315
    fn next(&mut self) -> Option<Self::Item> {
407
315
        self.inner.next()
408
315
    }
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
144k
fn needs_to_grow<T>(v: &Vec<T>, len: usize) -> bool {
435
144k
    v.len()
436
144k
        .checked_add(len)
437
144k
        .map_or(true, |needed| needed > v.capacity())
438
144k
}
439
440
impl<T> FallibleVec<T> for Vec<T> {
441
    #[inline(always)]
442
786k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
786k
        self.try_reserve(additional)
444
786k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_reserve
Line
Count
Source
442
1.50k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.50k
        self.try_reserve(additional)
444
1.50k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_reserve
Line
Count
Source
442
2.28k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
2.28k
        self.try_reserve(additional)
444
2.28k
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_reserve
Line
Count
Source
442
41.5k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
41.5k
        self.try_reserve(additional)
444
41.5k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_reserve
Line
Count
Source
442
392
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
392
        self.try_reserve(additional)
444
392
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_reserve
Line
Count
Source
442
33.9k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
33.9k
        self.try_reserve(additional)
444
33.9k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_reserve
Line
Count
Source
442
8.53k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
8.53k
        self.try_reserve(additional)
444
8.53k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_reserve
Line
Count
Source
442
885
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
885
        self.try_reserve(additional)
444
885
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_reserve
Line
Count
Source
442
11.0k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
11.0k
        self.try_reserve(additional)
444
11.0k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_reserve
Line
Count
Source
442
2.61k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
2.61k
        self.try_reserve(additional)
444
2.61k
    }
<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::Mp4parseItemExtent> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseItemExtent>>::try_reserve
Line
Count
Source
442
876
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
876
        self.try_reserve(additional)
444
876
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_reserve
Line
Count
Source
442
19.7k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
19.7k
        self.try_reserve(additional)
444
19.7k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_reserve
Line
Count
Source
442
5.31k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
5.31k
        self.try_reserve(additional)
444
5.31k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_reserve
Line
Count
Source
442
17.1k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
17.1k
        self.try_reserve(additional)
444
17.1k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_reserve
Line
Count
Source
442
1.00k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.00k
        self.try_reserve(additional)
444
1.00k
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
534k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
534k
        self.try_reserve(additional)
444
534k
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_reserve
Line
Count
Source
442
47.2k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
47.2k
        self.try_reserve(additional)
444
47.2k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_reserve
Line
Count
Source
442
31.3k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
31.3k
        self.try_reserve(additional)
444
31.3k
    }
<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.38k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.38k
        self.try_reserve(additional)
444
1.38k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_reserve
Line
Count
Source
442
1.88k
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
1.88k
        self.try_reserve(additional)
444
1.88k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_reserve
Line
Count
Source
442
168
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
168
        self.try_reserve(additional)
444
168
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_reserve
Line
Count
Source
442
4
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
4
        self.try_reserve(additional)
444
4
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_reserve
Line
Count
Source
442
986
    fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
443
986
        self.try_reserve(additional)
444
986
    }
445
446
    #[inline]
447
2.80M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
2.80M
        if self.len() == self.capacity() {
449
47.9k
            self.try_reserve(1)?;
450
2.75M
        }
451
2.80M
        Ok(self.push(elem))
452
2.80M
    }
<alloc::vec::Vec<fallible_collections::vec::TryVec<u8>> as fallible_collections::vec::FallibleVec<fallible_collections::vec::TryVec<u8>>>::try_push
Line
Count
Source
447
192k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
192k
        if self.len() == self.capacity() {
449
31.1k
            self.try_reserve(1)?;
450
161k
        }
451
192k
        Ok(self.push(elem))
452
192k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_push
Line
Count
Source
447
142k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
142k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
142k
        }
451
142k
        Ok(self.push(elem))
452
142k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_push
Line
Count
Source
447
11.0k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
11.0k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
11.0k
        }
451
11.0k
        Ok(self.push(elem))
452
11.0k
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_push
Line
Count
Source
447
102k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
102k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
102k
        }
451
102k
        Ok(self.push(elem))
452
102k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_push
Line
Count
Source
447
903
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
903
        if self.len() == self.capacity() {
449
36
            self.try_reserve(1)?;
450
867
        }
451
903
        Ok(self.push(elem))
452
903
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_push
Line
Count
Source
447
30.4k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
30.4k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
30.4k
        }
451
30.4k
        Ok(self.push(elem))
452
30.4k
    }
<alloc::vec::Vec<mp4parse::FLACMetadataBlock> as fallible_collections::vec::FallibleVec<mp4parse::FLACMetadataBlock>>::try_push
Line
Count
Source
447
4.18k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
4.18k
        if self.len() == self.capacity() {
449
327
            self.try_reserve(1)?;
450
3.85k
        }
451
4.18k
        Ok(self.push(elem))
452
4.18k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_push
Line
Count
Source
447
17.9k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
17.9k
        if self.len() == self.capacity() {
449
1.74k
            self.try_reserve(1)?;
450
16.2k
        }
451
17.9k
        Ok(self.push(elem))
452
17.9k
    }
<alloc::vec::Vec<mp4parse::ProtectionSchemeInfoBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSchemeInfoBox>>::try_push
Line
Count
Source
447
10.1k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
10.1k
        if self.len() == self.capacity() {
449
4.21k
            self.try_reserve(1)?;
450
5.90k
        }
451
10.1k
        Ok(self.push(elem))
452
10.1k
    }
<alloc::vec::Vec<mp4parse::SingleItemTypeReferenceBox> as fallible_collections::vec::FallibleVec<mp4parse::SingleItemTypeReferenceBox>>::try_push
Line
Count
Source
447
55.2k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
55.2k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
55.2k
        }
451
55.2k
        Ok(self.push(elem))
452
55.2k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_push
Line
Count
Source
447
3.72k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
3.72k
        if self.len() == self.capacity() {
449
844
            self.try_reserve(1)?;
450
2.87k
        }
451
3.72k
        Ok(self.push(elem))
452
3.72k
    }
<alloc::vec::Vec<mp4parse::ProtectionSystemSpecificHeaderBox> as fallible_collections::vec::FallibleVec<mp4parse::ProtectionSystemSpecificHeaderBox>>::try_push
Line
Count
Source
447
3.97k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
3.97k
        if self.len() == self.capacity() {
449
469
            self.try_reserve(1)?;
450
3.50k
        }
451
3.97k
        Ok(self.push(elem))
452
3.97k
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_push
Line
Count
Source
447
138k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
138k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
138k
        }
451
138k
        Ok(self.push(elem))
452
138k
    }
<alloc::vec::Vec<mp4parse::Track> as fallible_collections::vec::FallibleVec<mp4parse::Track>>::try_push
Line
Count
Source
447
47.5k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
47.5k
        if self.len() == self.capacity() {
449
1.99k
            self.try_reserve(1)?;
450
45.5k
        }
451
47.5k
        Ok(self.push(elem))
452
47.5k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_push
Line
Count
Source
447
1.02M
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
1.02M
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
1.02M
        }
451
1.02M
        Ok(self.push(elem))
452
1.02M
    }
<alloc::vec::Vec<mp4parse::ItemId> as fallible_collections::vec::FallibleVec<mp4parse::ItemId>>::try_push
Line
Count
Source
447
2.15k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
2.15k
        if self.len() == self.capacity() {
449
501
            self.try_reserve(1)?;
450
1.65k
        }
451
2.15k
        Ok(self.push(elem))
452
2.15k
    }
<alloc::vec::Vec<mp4parse::Sample> as fallible_collections::vec::FallibleVec<mp4parse::Sample>>::try_push
Line
Count
Source
447
21.0k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
21.0k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
21.0k
        }
451
21.0k
        Ok(self.push(elem))
452
21.0k
    }
<alloc::vec::Vec<mp4parse::DataBox> as fallible_collections::vec::FallibleVec<mp4parse::DataBox>>::try_push
Line
Count
Source
447
196k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
196k
        if self.len() == self.capacity() {
449
963
            self.try_reserve(1)?;
450
195k
        }
451
196k
        Ok(self.push(elem))
452
196k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseItemExtent> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseItemExtent>>::try_push
Line
Count
Source
447
89
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
89
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
89
        }
451
89
        Ok(self.push(elem))
452
89
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_push
Line
Count
Source
447
18.3k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
18.3k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
18.3k
        }
451
18.3k
        Ok(self.push(elem))
452
18.3k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_push
Line
Count
Source
447
5.88k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
5.88k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
5.88k
        }
451
5.88k
        Ok(self.push(elem))
452
5.88k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_push
Line
Count
Source
447
499k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
499k
        if self.len() == self.capacity() {
449
5.00k
            self.try_reserve(1)?;
450
494k
        }
451
499k
        Ok(self.push(elem))
452
499k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_push
Line
Count
Source
447
994
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
994
        if self.len() == self.capacity() {
449
14
            self.try_reserve(1)?;
450
980
        }
451
994
        Ok(self.push(elem))
452
994
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_push
Line
Count
Source
447
102k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
102k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
102k
        }
451
102k
        Ok(self.push(elem))
452
102k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_push
Line
Count
Source
447
163k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
163k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
163k
        }
451
163k
        Ok(self.push(elem))
452
163k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_push
Line
Count
Source
447
5.57k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
5.57k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
5.57k
        }
451
5.57k
        Ok(self.push(elem))
452
5.57k
    }
<alloc::vec::Vec<&mp4parse::ItemProperty> as fallible_collections::vec::FallibleVec<&mp4parse::ItemProperty>>::try_push
Line
Count
Source
447
721
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
721
        if self.len() == self.capacity() {
449
674
            self.try_reserve(1)?;
450
47
        }
451
721
        Ok(self.push(elem))
452
721
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_push
Line
Count
Source
447
5.57k
    fn try_push(&mut self, elem: T) -> Result<(), TryReserveError> {
448
5.57k
        if self.len() == self.capacity() {
449
0
            self.try_reserve(1)?;
450
5.57k
        }
451
5.57k
        Ok(self.push(elem))
452
5.57k
    }
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
225k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
225k
    where
467
225k
        Self: core::marker::Sized,
468
    {
469
225k
        let mut n = Self::new();
470
225k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
225k
        Ok(n)
472
225k
    }
<alloc::vec::Vec<mp4parse::TimeOffset> as fallible_collections::vec::FallibleVec<mp4parse::TimeOffset>>::try_with_capacity
Line
Count
Source
465
1.50k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
1.50k
    where
467
1.50k
        Self: core::marker::Sized,
468
    {
469
1.50k
        let mut n = Self::new();
470
1.50k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
1.50k
        Ok(n)
472
1.50k
    }
<alloc::vec::Vec<mp4parse::Association> as fallible_collections::vec::FallibleVec<mp4parse::Association>>::try_with_capacity
Line
Count
Source
465
2.28k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
2.28k
    where
467
2.28k
        Self: core::marker::Sized,
468
    {
469
2.28k
        let mut n = Self::new();
470
2.28k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
2.28k
        Ok(n)
472
2.28k
    }
<alloc::vec::Vec<mp4parse::SampleEntry> as fallible_collections::vec::FallibleVec<mp4parse::SampleEntry>>::try_with_capacity
Line
Count
Source
465
41.5k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
41.5k
    where
467
41.5k
        Self: core::marker::Sized,
468
    {
469
41.5k
        let mut n = Self::new();
470
41.5k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
41.5k
        Ok(n)
472
41.5k
    }
<alloc::vec::Vec<mp4parse::ItemInfoEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemInfoEntry>>::try_with_capacity
Line
Count
Source
465
392
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
392
    where
467
392
        Self: core::marker::Sized,
468
    {
469
392
        let mut n = Self::new();
470
392
        FallibleVec::try_reserve(&mut n, capacity)?;
471
392
        Ok(n)
472
392
    }
<alloc::vec::Vec<mp4parse::SampleToChunk> as fallible_collections::vec::FallibleVec<mp4parse::SampleToChunk>>::try_with_capacity
Line
Count
Source
465
33.9k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
33.9k
    where
467
33.9k
        Self: core::marker::Sized,
468
    {
469
33.9k
        let mut n = Self::new();
470
33.9k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
33.9k
        Ok(n)
472
33.9k
    }
<alloc::vec::Vec<mp4parse::TrackReferenceEntry> as fallible_collections::vec::FallibleVec<mp4parse::TrackReferenceEntry>>::try_with_capacity
Line
Count
Source
465
8.53k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
8.53k
    where
467
8.53k
        Self: core::marker::Sized,
468
    {
469
8.53k
        let mut n = Self::new();
470
8.53k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
8.53k
        Ok(n)
472
8.53k
    }
<alloc::vec::Vec<mp4parse::ItemPropertyAssociationEntry> as fallible_collections::vec::FallibleVec<mp4parse::ItemPropertyAssociationEntry>>::try_with_capacity
Line
Count
Source
465
885
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
885
    where
467
885
        Self: core::marker::Sized,
468
    {
469
885
        let mut n = Self::new();
470
885
        FallibleVec::try_reserve(&mut n, capacity)?;
471
885
        Ok(n)
472
885
    }
<alloc::vec::Vec<mp4parse::Edit> as fallible_collections::vec::FallibleVec<mp4parse::Edit>>::try_with_capacity
Line
Count
Source
465
11.0k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
11.0k
    where
467
11.0k
        Self: core::marker::Sized,
468
    {
469
11.0k
        let mut n = Self::new();
470
11.0k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
11.0k
        Ok(n)
472
11.0k
    }
<alloc::vec::Vec<mp4parse::Extent> as fallible_collections::vec::FallibleVec<mp4parse::Extent>>::try_with_capacity
Line
Count
Source
465
2.61k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
2.61k
    where
467
2.61k
        Self: core::marker::Sized,
468
    {
469
2.61k
        let mut n = Self::new();
470
2.61k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
2.61k
        Ok(n)
472
2.61k
    }
<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::Mp4parseItemExtent> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseItemExtent>>::try_with_capacity
Line
Count
Source
465
876
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
876
    where
467
876
        Self: core::marker::Sized,
468
    {
469
876
        let mut n = Self::new();
470
876
        FallibleVec::try_reserve(&mut n, capacity)?;
471
876
        Ok(n)
472
876
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackAudioSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackAudioSampleInfo>>::try_with_capacity
Line
Count
Source
465
19.7k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
19.7k
    where
467
19.7k
        Self: core::marker::Sized,
468
    {
469
19.7k
        let mut n = Self::new();
470
19.7k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
19.7k
        Ok(n)
472
19.7k
    }
<alloc::vec::Vec<mp4parse_capi::Mp4parseTrackVideoSampleInfo> as fallible_collections::vec::FallibleVec<mp4parse_capi::Mp4parseTrackVideoSampleInfo>>::try_with_capacity
Line
Count
Source
465
5.31k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
5.31k
    where
467
5.31k
        Self: core::marker::Sized,
468
    {
469
5.31k
        let mut n = Self::new();
470
5.31k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
5.31k
        Ok(n)
472
5.31k
    }
<alloc::vec::Vec<mp4parse::boxes::FourCC> as fallible_collections::vec::FallibleVec<mp4parse::boxes::FourCC>>::try_with_capacity
Line
Count
Source
465
17.1k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
17.1k
    where
467
17.1k
        Self: core::marker::Sized,
468
    {
469
17.1k
        let mut n = Self::new();
470
17.1k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
17.1k
        Ok(n)
472
17.1k
    }
<alloc::vec::Vec<(u8, u32)> as fallible_collections::vec::FallibleVec<(u8, u32)>>::try_with_capacity
Line
Count
Source
465
1.00k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
1.00k
    where
467
1.00k
        Self: core::marker::Sized,
468
    {
469
1.00k
        let mut n = Self::new();
470
1.00k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
1.00k
        Ok(n)
472
1.00k
    }
<alloc::vec::Vec<u32> as fallible_collections::vec::FallibleVec<u32>>::try_with_capacity
Line
Count
Source
465
24.3k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
24.3k
    where
467
24.3k
        Self: core::marker::Sized,
468
    {
469
24.3k
        let mut n = Self::new();
470
24.3k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
24.3k
        Ok(n)
472
24.3k
    }
<alloc::vec::Vec<u64> as fallible_collections::vec::FallibleVec<u64>>::try_with_capacity
Line
Count
Source
465
31.3k
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
31.3k
    where
467
31.3k
        Self: core::marker::Sized,
468
    {
469
31.3k
        let mut n = Self::new();
470
31.3k
        FallibleVec::try_reserve(&mut n, capacity)?;
471
31.3k
        Ok(n)
472
31.3k
    }
<alloc::vec::Vec<mp4parse::unstable::Indice> as fallible_collections::vec::FallibleVec<mp4parse::unstable::Indice>>::try_with_capacity
Line
Count
Source
465
168
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
168
    where
467
168
        Self: core::marker::Sized,
468
    {
469
168
        let mut n = Self::new();
470
168
        FallibleVec::try_reserve(&mut n, capacity)?;
471
168
        Ok(n)
472
168
    }
<alloc::vec::Vec<usize> as fallible_collections::vec::FallibleVec<usize>>::try_with_capacity
Line
Count
Source
465
4
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
4
    where
467
4
        Self: core::marker::Sized,
468
    {
469
4
        let mut n = Self::new();
470
4
        FallibleVec::try_reserve(&mut n, capacity)?;
471
4
        Ok(n)
472
4
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_with_capacity
Line
Count
Source
465
986
    fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>
466
986
    where
467
986
        Self: core::marker::Sized,
468
    {
469
986
        let mut n = Self::new();
470
986
        FallibleVec::try_reserve(&mut n, capacity)?;
471
986
        Ok(n)
472
986
    }
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
3.97k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
3.97k
        FallibleVec::try_reserve(self, other.len())?;
487
3.97k
        Ok(self.append(other))
488
3.97k
    }
<alloc::vec::Vec<u8> as fallible_collections::vec::FallibleVec<u8>>::try_append
Line
Count
Source
485
3.97k
    fn try_append(&mut self, other: &mut Self) -> Result<(), TryReserveError> {
486
3.97k
        FallibleVec::try_reserve(self, other.len())?;
487
3.97k
        Ok(self.append(other))
488
3.97k
    }
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
144k
    fn try_extend_from_slice_no_copy(&mut self, other: &[T]) -> Result<(), TryReserveError>
537
144k
    where
538
144k
        T: TryClone,
539
    {
540
144k
        if needs_to_grow(self, other.len()) {
541
68.3k
            self.try_reserve(other.len())?;
542
76.5k
        }
543
144k
        let mut len = self.len();
544
144k
        let mut iterator = other.iter();
545
4.49M
        while let Some(element) = iterator.next() {
546
            unsafe {
547
4.35M
                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
4.35M
                len += 1;
550
4.35M
                self.set_len(len);
551
            }
552
        }
553
144k
        Ok(())
554
144k
    }
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
}