pub trait OptionIteratorExt<'a>: Iterator<Item = Result<(OptionNumber, &'a [u8]), Error>> {
// Required method
fn find_next(
&mut self,
key: OptionNumber,
) -> Option<Result<(OptionNumber, &'a [u8]), Error>>;
// Provided methods
fn find_next_of<T>(&mut self, key: OptionKey<T>) -> Option<Result<T, Error>>
where T: TryOptionValueFrom<'a> + Sized { ... }
fn extract_uri(&self) -> Result<RelRefBuf, Error>
where Self: Sized + Clone { ... }
fn extract_location(&self) -> Result<RelRefBuf, Error>
where Self: Sized + Clone { ... }
}
Expand description
Extension trait for option iterators that provide additional convenient accessors.
Required Methods§
Sourcefn find_next(
&mut self,
key: OptionNumber,
) -> Option<Result<(OptionNumber, &'a [u8]), Error>>
fn find_next( &mut self, key: OptionNumber, ) -> Option<Result<(OptionNumber, &'a [u8]), Error>>
Moves the iterator forward until it finds a matching key or the spot where it should have been.
If found, returns the option number and a byte slice of the value.
Does not consume any options after the matching key.
Provided Methods§
Sourcefn find_next_of<T>(&mut self, key: OptionKey<T>) -> Option<Result<T, Error>>where
T: TryOptionValueFrom<'a> + Sized,
fn find_next_of<T>(&mut self, key: OptionKey<T>) -> Option<Result<T, Error>>where
T: TryOptionValueFrom<'a> + Sized,
Typed version of OptionIteratorExt::find_next
.
Moves the iterator forward until it finds a matching key or the spot where it should have been.
If found, returns the value of the option key.
Does not consume any options after the matching key.
Sourcefn extract_uri(&self) -> Result<RelRefBuf, Error>
fn extract_uri(&self) -> Result<RelRefBuf, Error>
Extracts a URI relative-reference from the remaining URI_PATH and URI_QUERY options, moving the iterator past them.
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.