Skip to main content

QrDecoder

Trait QrDecoder 

Source
pub trait QrDecoder {
    type Error;

    // Required method
    fn decode(
        &self,
        image: GrayPixels<'_>,
    ) -> Result<Vec<DecodedQrCode>, Self::Error>;
}
Expand description

A QR code decoder: turns a grayscale image back into data.

Implement this for your own decoder (e.g. wrapping a native binding); use the bundled RqrrDecoder (behind the rqrr feature) for the rqrr crate.

decode returns a Vec because an image may contain more than one QR code; the order is decoder-defined.

Required Associated Types§

Source

type Error

The error type returned on failure.

Required Methods§

Source

fn decode( &self, image: GrayPixels<'_>, ) -> Result<Vec<DecodedQrCode>, Self::Error>

Decodes all QR codes found in image.

§Errors

Returns Self::Error if decoding fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§