#[non_exhaustive]pub enum VncEvent {
SetResolution(Screen),
SetPixelFormat(PixelFormat),
RawImage(Rect, Vec<u8>),
Copy(Rect, Rect),
JpegImage(Rect, Vec<u8>),
SetCursor(Rect, Vec<u8>),
Bell,
Text(String),
Error(String),
}Expand description
Events generated by the crate::VncClient
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SetResolution(Screen)
Tell the client how to display the images
if let VncEvent::SetResolution(resolution) = event {
window.resize(screen.width, screen.height);
}Note that this event may be recived multiple times
If the crate::VncEncoding::DesktopSizePseudo is set
SetPixelFormat(PixelFormat)
If the connector doesn’t call set_pixel_format method
The engine will generate a VncEvent::SetPixelFormat to let the window know how to render image
RawImage(Rect, Vec<u8>)
Raw image data in the order followed by informed PixelFormat
Copy(Rect, Rect)
Copy image data from the second rect to the first
JpegImage(Rect, Vec<u8>)
A jpeg image if using Tight encoding,
Encoding the bytes with base64 and render it with “”,
SetCursor(Rect, Vec<u8>)
Will be generated if crate::VncEncoding::CursorPseudo is set
According to RFC6143, section-7.8.1
Bell
Just ring a bell
Text(String)
Will be generated everytime the vncserver’s clipboarded get updated
Note that only Latin-1 character set is allowed
According to RFC6143
Error(String)
If any unexpected error happens in the async process routines This event will propagate the error to the current context