Struct rqrr::Grid[][src]

pub struct Grid<G> {
    pub grid: G,
    pub bounds: [Point; 4],
}

Wrapper around any grid that can be interpreted as a QR code

Fields

grid: G

The backing binary square

bounds: [Point; 4]

The bounds of the square, in underlying coordinates.

If this grid references for example an underlying image, these values will be set to coordinates in that image.

Implementations

impl<G> Grid<G> where
    G: BitGrid
[src]

pub fn new(grid: G) -> Self[src]

Create a new grid from a BitGrid.

This just initialises the bounds to 0.

pub fn decode(&self) -> Result<(MetaData, String), DeQRError>[src]

Try to decode the grid.

If successful returns the decoded string as well as metadata about the code.

pub fn decode_to<W>(&self, writer: W) -> Result<MetaData, DeQRError> where
    W: Write
[src]

Try to decode the grid.

Instead of returning a String, this methode writes the decoded result to the given writer

Warning: This may lead to half decoded content to be written to the writer.

Trait Implementations

impl<G: Clone> Clone for Grid<G>[src]

impl<G: Debug> Debug for Grid<G>[src]

Auto Trait Implementations

impl<G> RefUnwindSafe for Grid<G> where
    G: RefUnwindSafe

impl<G> Send for Grid<G> where
    G: Send

impl<G> Sync for Grid<G> where
    G: Sync

impl<G> Unpin for Grid<G> where
    G: Unpin

impl<G> UnwindSafe for Grid<G> where
    G: UnwindSafe

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<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.