pub struct Scanner { /* private fields */ }Expand description
Reusable QR scanner — configure once, scan many. Send + Sync, no
interior state: share one instance across threads freely.
Implementations§
Source§impl Scanner
impl Scanner
Sourcepub fn builder() -> ScannerBuilder
pub fn builder() -> ScannerBuilder
Start building a scanner.
Sourcepub fn scan(&self, input: ImageInput<'_>) -> Result<ScanReport>
pub fn scan(&self, input: ImageInput<'_>) -> Result<ScanReport>
Scan one input. “No QR found” is Ok with empty detections.
§Errors
Only real faults: an option outside its domain (QRS-006, checked
before the input), invalid/oversized input (QRS-001..004) or
cancellation (QRS-005) — never “nothing found”.
Sourcepub fn scan_cancellable(
&self,
input: ImageInput<'_>,
cancel: &CancelToken,
) -> Result<ScanReport>
pub fn scan_cancellable( &self, input: ImageInput<'_>, cancel: &CancelToken, ) -> Result<ScanReport>
Scan with a cooperative cancellation token (checked between decode attempts — a running engine call is not interruptible).
§Errors
Same contract as Scanner::scan, plus QRS-005 once cancel fires.
Sourcepub fn scan_batch(&self, inputs: &[ImageInput<'_>]) -> Vec<Result<ScanReport>>
pub fn scan_batch(&self, inputs: &[ImageInput<'_>]) -> Vec<Result<ScanReport>>
Scan a batch — the generator best-of-N gate. Parallel under the
parallel feature (results identical to sequential by construction).
Per-input results: one Err does not fail the batch.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Scanner
impl Freeze for Scannerwhere
*const u8 is !null: Freeze,
PhantomData<StressAxis>: Freeze,
PhantomData<ScoreCheck>: Freeze,
PhantomData<[u8; 3]>: Freeze,
PhantomData<Symbology>: Freeze,
impl Move for Scanner
impl RefUnwindSafe for Scanner
impl Send for Scannerwhere
RawVecInner: Send,
impl Sync for Scannerwhere
RawVecInner: Sync,
impl Unpin for Scanner
impl UnsafeUnpin for Scannerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<StressAxis>: UnsafeUnpin,
PhantomData<ScoreCheck>: UnsafeUnpin,
PhantomData<[u8; 3]>: UnsafeUnpin,
PhantomData<Symbology>: UnsafeUnpin,
impl UnwindSafe for Scannerwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more