January 2019
Intermediate to advanced
520 pages
14h 32m
English
We don't use the convert function in this example, but we need the same parameters and we'll take them from the Resize struct:
pub struct Resize { pub buffer: Buffer, pub width: u16, pub height: u16,} impl Message for Resize { type Result = ImageResult<Buffer>;}
We provide a buffer with the image data, and the desired width and height. In the Message trait implementation of the Resize struct, we use the ImageResult<Buffer> type. The same result type that the convert function returns. We'll get this value from the actor in the HTTP handler implementation later.
Read now
Unlock full access