pub struct LiveTextSubject { /* private fields */ }Implementations§
Source§impl LiveTextSubject
impl LiveTextSubject
Sourcepub fn bounds(&self) -> Result<Rect, VisionKitError>
pub fn bounds(&self) -> Result<Rect, VisionKitError>
Examples found in repository?
examples/05_live_text_interaction.rs (line 88)
69fn print_subject_state(
70 interaction: &LiveTextInteraction,
71) -> Result<(), Box<dyn std::error::Error>> {
72 println!(
73 "subject unavailable case: {:?}",
74 LiveTextSubjectUnavailable::ImageUnavailable
75 );
76 match interaction.begin_subject_analysis_if_necessary() {
77 Ok(()) => println!("subject analysis started"),
78 Err(error) => println!("subject analysis started: {error}"),
79 }
80 match interaction.subjects() {
81 Ok(subjects) => {
82 println!("subjects: {}", subjects.len());
83 println!(
84 "highlighted subjects: {}",
85 interaction.highlighted_subjects()?.len()
86 );
87 if let Some(subject) = subjects.first() {
88 println!("subject bounds: {:?}", subject.bounds()?);
89 }
90 match interaction.image_for_subjects(&subjects) {
91 Ok(image) => println!("subject image bytes: {}", image.png_data.len()),
92 Err(error) => println!("subject image bytes: {error}"),
93 }
94 }
95 Err(error) => println!("subjects: {error}"),
96 }
97 Ok(())
98}pub fn image(&self) -> Result<LiveTextImageData, VisionKitError>
Trait Implementations§
Source§impl Drop for LiveTextSubject
impl Drop for LiveTextSubject
Auto Trait Implementations§
impl Freeze for LiveTextSubject
impl RefUnwindSafe for LiveTextSubject
impl !Send for LiveTextSubject
impl !Sync for LiveTextSubject
impl Unpin for LiveTextSubject
impl UnsafeUnpin for LiveTextSubject
impl UnwindSafe for LiveTextSubject
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