Skip to main content

ToTrustIter

Trait ToTrustIter 

Source
pub trait ToTrustIter: IntoIterator {
    // Required method
    fn to_trust(self, len: usize) -> TrustIter<Self::IntoIter> ;
}
Expand description

A trait for converting an iterator into a TrustIter.

This trait provides a method to wrap an iterator with a known length into a TrustIter, which implements TrustedLen.

Required Methods§

Source

fn to_trust(self, len: usize) -> TrustIter<Self::IntoIter>

Converts the iterator into a TrustIter with a known length.

§Arguments
  • self - The iterator to be converted.
  • len - The known length of the iterator.
§Returns

A TrustIter wrapping the original iterator with the specified length.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§