pub trait TryExtend<A> {
type Error;
// Required method
fn try_extend<T>(&mut self, iter: &mut T) -> Result<(), Self::Error>
where T: Iterator<Item = A>;
// Provided method
fn try_extend_from_slice(&mut self, slice: &[A]) -> Result<(), Self::Error>
where A: Clone { ... }
}
Expand description
Fallible equivalent of core::iter::Extend
- extends a collection
with the contents of an iterator, but with the option to return an error
in the event the container’s capacity has been exceeded.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.