Available on crate feature
async only.Expand description
Async Vision API — Future-based wrappers for VNImageRequestHandler and friends.
Enable with features = ["async"]. Each wrapper dispatches the synchronous
Vision request on a background queue (via DispatchQueue.global) and returns
a std::future::Future that resolves when the request completes.
§Tier-2 note
Multi-fire delegates, KVO, and continuous observation streams (e.g.
VNVideoProcessor frame-by-frame callbacks, optical-flow streaming) are
not included here — they follow a Stream pattern and belong in a
future Tier-2 module.
§Example
use apple_vision::async_api::AsyncRecognizeText;
use apple_vision::recognize_text::RecognitionLevel;
let texts = AsyncRecognizeText::new(RecognitionLevel::Accurate, true)
.recognize_in_path("/path/to/image.png")
.await?;
for text in &texts {
println!("{}", text.text);
}Structs§
- Async
Detect Barcodes detect_barcodes - Async wrapper for
VNDetectBarcodesRequest. - Async
Detect Faces detect_faces - Async wrapper for
VNDetectFaceRectanglesRequest. - Async
Person Segmentation segmentation - Async wrapper for
VNGeneratePersonSegmentationRequest. - Async
Recognize Text recognize_text - Async wrapper for
VNRecognizeTextRequest. - Detect
Barcodes Future detect_barcodes - Future resolving to a
Vec<DetectedBarcode>. - Detect
Faces Future detect_faces - Future resolving to a
Vec<DetectedFace>. - Person
Segmentation Future segmentation - Future resolving to a
SegmentationMask. - Recognize
Text Future recognize_text - Future resolving to a
Vec<RecognizedText>.