[][src]Struct qr_code::optimize::Parser

pub struct Parser<'a> { /* fields omitted */ }

QR code data parser to classify the input into distinct segments.

Implementations

impl<'a> Parser<'a>[src]

pub fn new(data: &[u8]) -> Parser<'_>

Notable traits for Parser<'a>

impl<'a> Iterator for Parser<'a> type Item = Segment;
[src]

Creates a new iterator which parse the data into segments that only contains their exclusive subsets. No optimization is done at this point.

use qr_code::optimize::{Parser, Segment};
use qr_code::types::Mode::{Alphanumeric, Numeric, Byte};

let parse_res = Parser::new(b"ABC123abcd").collect::<Vec<Segment>>();
assert_eq!(parse_res, vec![Segment { mode: Alphanumeric, begin: 0, end: 3 },
                           Segment { mode: Numeric, begin: 3, end: 6 },
                           Segment { mode: Byte, begin: 6, end: 10 }]);

impl<'a> Parser<'a>[src]

pub fn optimize(self, version: Version) -> Optimizer<Parser<'a>>

Notable traits for Optimizer<I>

impl<I: Iterator<Item = Segment>> Iterator for Optimizer<I> type Item = Segment;
[src]

Trait Implementations

impl<'a> Iterator for Parser<'a>[src]

type Item = Segment

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Parser<'a>

impl<'a> Send for Parser<'a>

impl<'a> Sync for Parser<'a>

impl<'a> Unpin for Parser<'a>

impl<'a> UnwindSafe for Parser<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.