Enum vnc::event::VncEvent

source ·
#[non_exhaustive]
pub enum VncEvent {
    SetResolution(Screen),
    SetPixelFormat(PixelFormat),
    RawImage(RectVec<u8>),
    Copy(RectRect),
    JpegImage(RectVec<u8>),
    SetCursor(RectVec<u8>),
    Bell,
    Text(String),
}
Expand description

Events generated by the crate::VncClient

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

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(RectVec<u8>)

Raw image data in the order followed by informed PixelFormat

Copy(RectRect)

Copy image data from the second rect to the first

JpegImage(RectVec<u8>)

A jpeg image if using Tight encoding,

Encoding the bytes with base64 and render it with “”,

SetCursor(RectVec<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

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more