Struct domain::base::scan::IterScanner

source ·
pub struct IterScanner<Iter: Iterator, Octets> { /* private fields */ }
Expand description

A simple scanner atop an iterator of strings.

The type is generic over the iterator as well as the octets sequence to use for returned data. The types associated octets builder is used to create values.

Implementations§

source§

impl<Iter: Iterator, Octets> IterScanner<Iter, Octets>

source

pub fn new<I: IntoIterator<IntoIter = Iter>>(iter: I) -> Self

Creates a new scanner from an iterator.

source

pub fn is_exhausted(&mut self) -> bool

Returns whether the iterator is exhausted.

Trait Implementations§

source§

impl<Iter, Item, Octets> Scanner for IterScanner<Iter, Octets>
where Item: AsRef<str>, Iter: Iterator<Item = Item>, Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder + Composer,

§

type Octets = Octets

The type of octet sequences returned by the scanner.
§

type OctetsBuilder = <Octets as FromBuilder>::Builder

The octets builder used internally and returned upon request.
§

type Dname = Dname<Octets>

The type of a domain name returned by the scanner.
§

type Error = StrError

The error type of the scanner.
source§

fn has_space(&self) -> bool

Returns whether the next token is preceded by white space.
source§

fn continues(&mut self) -> bool

Returns whether there are more tokens in the entry. Read more
source§

fn scan_symbols<F>(&mut self, op: F) -> Result<(), Self::Error>
where F: FnMut(Symbol) -> Result<(), Self::Error>,

Scans a token into a sequence of symbols. Read more
source§

fn scan_entry_symbols<F>(&mut self, op: F) -> Result<(), Self::Error>
where F: FnMut(EntrySymbol) -> Result<(), Self::Error>,

Scans the remainder of the entry as symbols. Read more
source§

fn convert_token<C: ConvertSymbols<Symbol, Self::Error>>( &mut self, convert: C, ) -> Result<Self::Octets, Self::Error>

Converts the symbols of a token into an octets sequence. Read more
source§

fn convert_entry<C: ConvertSymbols<EntrySymbol, Self::Error>>( &mut self, convert: C, ) -> Result<Self::Octets, Self::Error>

Converts the symbols of a token into an octets sequence. Read more
source§

fn scan_octets(&mut self) -> Result<Self::Octets, Self::Error>

Scans a token into an octets sequence. Read more
source§

fn scan_ascii_str<F, T>(&mut self, op: F) -> Result<T, Self::Error>
where F: FnOnce(&str) -> Result<T, Self::Error>,

Scans a token as a borrowed ASCII string. Read more
source§

fn scan_dname(&mut self) -> Result<Self::Dname, Self::Error>

Scans a token into a domain name.
source§

fn scan_charstr(&mut self) -> Result<CharStr<Self::Octets>, Self::Error>

Scans a token into a character string. Read more
source§

fn scan_string(&mut self) -> Result<Str<Self::Octets>, Self::Error>

Scans a token as a UTF-8 string.
source§

fn scan_charstr_entry(&mut self) -> Result<Self::Octets, Self::Error>

Scans a sequence of character strings until the end of the entry. Read more
source§

fn scan_opt_unknown_marker(&mut self) -> Result<bool, Self::Error>

Scans an optional unknown rdata marker. Read more
source§

fn octets_builder(&mut self) -> Result<Self::OctetsBuilder, Self::Error>

Returns an empty octets builder. Read more

Auto Trait Implementations§

§

impl<Iter, Octets> Freeze for IterScanner<Iter, Octets>
where Iter: Freeze, <Iter as Iterator>::Item: Freeze,

§

impl<Iter, Octets> RefUnwindSafe for IterScanner<Iter, Octets>
where Iter: RefUnwindSafe, Octets: RefUnwindSafe, <Iter as Iterator>::Item: RefUnwindSafe,

§

impl<Iter, Octets> Send for IterScanner<Iter, Octets>
where Iter: Send, Octets: Send, <Iter as Iterator>::Item: Send,

§

impl<Iter, Octets> Sync for IterScanner<Iter, Octets>
where Iter: Sync, Octets: Sync, <Iter as Iterator>::Item: Sync,

§

impl<Iter, Octets> Unpin for IterScanner<Iter, Octets>
where Iter: Unpin, Octets: Unpin, <Iter as Iterator>::Item: Unpin,

§

impl<Iter, Octets> UnwindSafe for IterScanner<Iter, Octets>
where Iter: UnwindSafe, Octets: UnwindSafe, <Iter as Iterator>::Item: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V