pub struct BarcodeScannerEffects<'a, 'b, S: AppState> { /* private fields */ }Expand description
Convenience builder for standard barcode scanner host capabilities.
Implementations§
Source§impl<'a, 'b, S: AppState> BarcodeScannerEffects<'a, 'b, S>
impl<'a, 'b, S: AppState> BarcodeScannerEffects<'a, 'b, S>
Sourcepub fn scan(self, request: BarcodeScanRequest) -> EffectBuilder<'a, 'b, S>
pub fn scan(self, request: BarcodeScanRequest) -> EffectBuilder<'a, 'b, S>
Starts a live barcode scanning session.
request.formats should list only formats the product accepts. The host
may open a camera UI, display prompt, and return one or more decoded
barcode values depending on allow_multiple.
Sourcepub fn decode_image(
self,
request: BarcodeImageDecodeRequest,
) -> EffectBuilder<'a, 'b, S>
pub fn decode_image( self, request: BarcodeImageDecodeRequest, ) -> EffectBuilder<'a, 'b, S>
Decodes barcode data from image bytes supplied by the app.
Use this when the image already exists, such as a file import or camera frame captured elsewhere. The host should not request camera permission for this operation unless its decoder specifically requires it.
Sourcepub fn cancel_scan(self) -> EffectBuilder<'a, 'b, S>
pub fn cancel_scan(self) -> EffectBuilder<'a, 'b, S>
Cancels the active live barcode scanning session.
Use this when the user leaves the scanning screen or chooses another input path. Hosts may treat cancellation of a non-running session as success.
Auto Trait Implementations§
impl<'a, 'b, S> Freeze for BarcodeScannerEffects<'a, 'b, S>
impl<'a, 'b, S> !RefUnwindSafe for BarcodeScannerEffects<'a, 'b, S>
impl<'a, 'b, S> Send for BarcodeScannerEffects<'a, 'b, S>
impl<'a, 'b, S> Sync for BarcodeScannerEffects<'a, 'b, S>
impl<'a, 'b, S> Unpin for BarcodeScannerEffects<'a, 'b, S>
impl<'a, 'b, S> UnsafeUnpin for BarcodeScannerEffects<'a, 'b, S>
impl<'a, 'b, S> !UnwindSafe for BarcodeScannerEffects<'a, 'b, S>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.