pub(super) async fn do_work(&mut self, work: Work) {
        if work == Work::Scan {
            unreachable!("Tried to do scanning work on a ScannedPage.");
        }

        match &mut self.kind {
            Image(r, u) => {
                if work.upscale() {
                    u.do_work(work).await
                } else {
                    r.do_work(work).await
                }
            }
            UnupscaledImage(r) => r.do_work(work).await,
            Animation(a) => a.do_work(work).await,
            Video(v) => v.do_work(work).await,
            Invalid(_) => unreachable!("Tried to do work on an invalid scanned page."),
        }
    }
// These functions should return after each level of work is complete.
These functions should return after each level of work is complete.
These functions should return after each level of work is complete .
pub(super) async fn do_work(&mut self, work: Work) {
        if work == Work::Scan {
            unreachable!("Tried to do scanning work on a ScannedPage.");
        }
        match &mut self.kind {
            Image(r, u) => {
                if work.upscale() {
                    u.do_work(work).await
                } else {
                    r.do_work(work).await
                }
            }
            UnupscaledImage(r) => r.do_work(work).await,
            Animation(a) => a.do_work(work).await,
            Video(v) => v.do_work(work).await,
            Invalid(_) => unreachable!("Tried to do work on an invalid scanned page."),
        }
    }
pub ( super ) async fn do_work ( & mut self , work : Work ) { if work == Work :: Scan { unreachable ! ( " " ) ; } match & mut self . kind { Image ( r , u ) => { if work . upscale ( ) { u . do_work ( work ) . await } else { r . do_work ( work ) . await } } UnupscaledImage ( r ) => r . do_work ( work ) . await , Animation ( a ) => a . do_work ( work ) . await , Video ( v ) => v . do_work ( work ) . await , Invalid ( _ ) => unreachable ! ( " " ) , } }
These functions should return after each level of work is complete.
These functions should return after each level of work is complete .
&mut self
work
Work
&mut self
work
Work