pub trait TryExtend<T> {
type Error;
// Required method
fn try_extend<I: IntoIterator<Item = T>>(
&mut self,
iter: I,
) -> Result<(), Self::Error>;
// Provided method
fn try_extend_one(&mut self, item: T) -> Result<(), Self::Error> { ... }
}Expand description
Fallible variant of the Extend trait
Required Associated Types§
Required Methods§
Sourcefn try_extend<I: IntoIterator<Item = T>>(
&mut self,
iter: I,
) -> Result<(), Self::Error>
fn try_extend<I: IntoIterator<Item = T>>( &mut self, iter: I, ) -> Result<(), Self::Error>
Tries to extends a collection with the contents of an iterator.
Provided Methods§
Sourcefn try_extend_one(&mut self, item: T) -> Result<(), Self::Error>
fn try_extend_one(&mut self, item: T) -> Result<(), Self::Error>
Tries to extend a collection with exactly one element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl TryExtend<char> for NtUnicodeString
Available on crate feature alloc only.
impl TryExtend<char> for NtUnicodeString
Available on crate feature
alloc only.type Error = NtStringError
Source§impl<'a> TryExtend<&'a U16CStr> for NtUnicodeString
Available on crate feature alloc only.
impl<'a> TryExtend<&'a U16CStr> for NtUnicodeString
Available on crate feature
alloc only.type Error = NtStringError
Source§impl<'a> TryExtend<&'a U16Str> for NtUnicodeString
Available on crate feature alloc only.
impl<'a> TryExtend<&'a U16Str> for NtUnicodeString
Available on crate feature
alloc only.type Error = NtStringError
Source§impl<'a> TryExtend<&'a str> for NtUnicodeString
Available on crate feature alloc only.
impl<'a> TryExtend<&'a str> for NtUnicodeString
Available on crate feature
alloc only.