VNCBuilder

Struct VNCBuilder 

Source
pub struct VNCBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> VNCBuilder<S>

Source

pub fn build(self) -> VNC
where S: IsComplete,

Finish building and return the requested object

Source

pub fn display(self, value: VNCDisplay) -> VNCBuilder<SetDisplay<S>>
where S::Display: IsUnset,

Required.

Source

pub fn reverse(self, value: OnOff) -> VNCBuilder<SetReverse<S>>
where S::Reverse: IsUnset,

Optional (Some / Option setters).

Connect to a listening VNC client via a “reverse” connection. The client is specified by the display. For reverse network connections (host:d,reverse), the d argument is a TCP port number, not a display number.

Source

pub fn maybe_reverse(self, value: Option<OnOff>) -> VNCBuilder<SetReverse<S>>
where S::Reverse: IsUnset,

Optional (Some / Option setters).

Connect to a listening VNC client via a “reverse” connection. The client is specified by the display. For reverse network connections (host:d,reverse), the d argument is a TCP port number, not a display number.

Source

pub fn websocket(self, value: OnOff) -> VNCBuilder<SetWebsocket<S>>
where S::Websocket: IsUnset,

Optional (Some / Option setters).

Opens an additional TCP listening port dedicated to VNC Websocket connections. If a bare websocket option is given, the Websocket port is 5700+display. An alternative port can be specified with the syntax websocket\ =port.

If host is specified connections will only be allowed from this host. It is possible to control the websocket listen address independently, using the syntax websocket\ =host:port.

Websocket could be allowed over UNIX domain socket, using the syntax websocket\ =unix:path, where path is the location of a unix socket to listen for connections on.

If no TLS credentials are provided, the websocket connection runs in unencrypted mode. If TLS credentials are provided, the websocket connection requires encrypted client connections.

Source

pub fn maybe_websocket( self, value: Option<OnOff>, ) -> VNCBuilder<SetWebsocket<S>>
where S::Websocket: IsUnset,

Optional (Some / Option setters).

Opens an additional TCP listening port dedicated to VNC Websocket connections. If a bare websocket option is given, the Websocket port is 5700+display. An alternative port can be specified with the syntax websocket\ =port.

If host is specified connections will only be allowed from this host. It is possible to control the websocket listen address independently, using the syntax websocket\ =host:port.

Websocket could be allowed over UNIX domain socket, using the syntax websocket\ =unix:path, where path is the location of a unix socket to listen for connections on.

If no TLS credentials are provided, the websocket connection runs in unencrypted mode. If TLS credentials are provided, the websocket connection requires encrypted client connections.

Source

pub fn password(self, value: OnOff) -> VNCBuilder<SetPassword<S>>
where S::Password: IsUnset,

Optional (Some / Option setters).

Require that password based authentication is used for client connections.

The password must be set separately using the set_password command in the :ref:QEMU monitor. The syntax to change your password is: set_password <protocol> <password> where could be either “vnc” or “spice”.

If you would like to change password expiration, you should use expire_password <protocol> <expiration-time> where expiration time could be one of the following options: now, never, +seconds or UNIX time of expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800 to make password expire on “Mon Apr 23 12:00:00 EDT 2012” (UNIX time for this date and time).

You can also use keywords “now” or “never” for the expiration time to allow password to expire immediately or never expire.

Source

pub fn maybe_password(self, value: Option<OnOff>) -> VNCBuilder<SetPassword<S>>
where S::Password: IsUnset,

Optional (Some / Option setters).

Require that password based authentication is used for client connections.

The password must be set separately using the set_password command in the :ref:QEMU monitor. The syntax to change your password is: set_password <protocol> <password> where could be either “vnc” or “spice”.

If you would like to change password expiration, you should use expire_password <protocol> <expiration-time> where expiration time could be one of the following options: now, never, +seconds or UNIX time of expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800 to make password expire on “Mon Apr 23 12:00:00 EDT 2012” (UNIX time for this date and time).

You can also use keywords “now” or “never” for the expiration time to allow password to expire immediately or never expire.

Source

pub fn password_secret(self, value: String) -> VNCBuilder<SetPasswordSecret<S>>
where S::PasswordSecret: IsUnset,

Optional (Some / Option setters).

Require that password based authentication is used for client connections, using the password provided by the secret object identified by secret-id.

Source

pub fn maybe_password_secret( self, value: Option<String>, ) -> VNCBuilder<SetPasswordSecret<S>>
where S::PasswordSecret: IsUnset,

Optional (Some / Option setters).

Require that password based authentication is used for client connections, using the password provided by the secret object identified by secret-id.

Source

pub fn tls_creds(self, value: String) -> VNCBuilder<SetTlsCreds<S>>
where S::TlsCreds: IsUnset,

Optional (Some / Option setters).

Provides the ID of a set of TLS credentials to use to secure the VNC server. They will apply to both the normal VNC server socket and the websocket socket (if enabled). Setting TLS credentials will cause the VNC server socket to enable the VeNCrypt auth mechanism. The credentials should have been previously created using the -object tls-creds argument.

Source

pub fn maybe_tls_creds( self, value: Option<String>, ) -> VNCBuilder<SetTlsCreds<S>>
where S::TlsCreds: IsUnset,

Optional (Some / Option setters).

Provides the ID of a set of TLS credentials to use to secure the VNC server. They will apply to both the normal VNC server socket and the websocket socket (if enabled). Setting TLS credentials will cause the VNC server socket to enable the VeNCrypt auth mechanism. The credentials should have been previously created using the -object tls-creds argument.

Source

pub fn tls_authz(self, value: String) -> VNCBuilder<SetTlsAuthz<S>>
where S::TlsAuthz: IsUnset,

Optional (Some / Option setters).

Provides the ID of the QAuthZ authorization object against which the client’s x509 distinguished name will validated. This object is only resolved at time of use, so can be deleted and recreated on the fly while the VNC server is active. If missing, it will default to denying access.

Source

pub fn maybe_tls_authz( self, value: Option<String>, ) -> VNCBuilder<SetTlsAuthz<S>>
where S::TlsAuthz: IsUnset,

Optional (Some / Option setters).

Provides the ID of the QAuthZ authorization object against which the client’s x509 distinguished name will validated. This object is only resolved at time of use, so can be deleted and recreated on the fly while the VNC server is active. If missing, it will default to denying access.

Source

pub fn sasl(self, value: OnOff) -> VNCBuilder<SetSasl<S>>
where S::Sasl: IsUnset,

Optional (Some / Option setters).

Require that the client use SASL to authenticate with the VNC server. The exact choice of authentication method used is controlled from the system / user’s SASL configuration file for the ‘qemu’ service. This is typically found in /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, an environment variable SASL_CONF_PATH can be used to make it search alternate locations for the service config. While some SASL auth methods can also provide data encryption (eg GSSAPI), it is recommended that SASL always be combined with the ‘tls’ and ‘x509’ settings to enable use of SSL and server certificates. This ensures a data encryption preventing compromise of authentication credentials. See the :ref:VNC security section in the System Emulation Users Guide for details on using SASL authentication.

Source

pub fn maybe_sasl(self, value: Option<OnOff>) -> VNCBuilder<SetSasl<S>>
where S::Sasl: IsUnset,

Optional (Some / Option setters).

Require that the client use SASL to authenticate with the VNC server. The exact choice of authentication method used is controlled from the system / user’s SASL configuration file for the ‘qemu’ service. This is typically found in /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, an environment variable SASL_CONF_PATH can be used to make it search alternate locations for the service config. While some SASL auth methods can also provide data encryption (eg GSSAPI), it is recommended that SASL always be combined with the ‘tls’ and ‘x509’ settings to enable use of SSL and server certificates. This ensures a data encryption preventing compromise of authentication credentials. See the :ref:VNC security section in the System Emulation Users Guide for details on using SASL authentication.

Source

pub fn sasl_authz(self, value: String) -> VNCBuilder<SetSaslAuthz<S>>
where S::SaslAuthz: IsUnset,

Optional (Some / Option setters).

Provides the ID of the QAuthZ authorization object against which the client’s SASL username will validated. This object is only resolved at time of use, so can be deleted and recreated on the fly while the VNC server is active. If missing, it will default to denying access.

Source

pub fn maybe_sasl_authz( self, value: Option<String>, ) -> VNCBuilder<SetSaslAuthz<S>>
where S::SaslAuthz: IsUnset,

Optional (Some / Option setters).

Provides the ID of the QAuthZ authorization object against which the client’s SASL username will validated. This object is only resolved at time of use, so can be deleted and recreated on the fly while the VNC server is active. If missing, it will default to denying access.

Source

pub fn acl(self, value: OnOff) -> VNCBuilder<SetAcl<S>>
where S::Acl: IsUnset,

Optional (Some / Option setters).

Legacy method for enabling authorization of clients against the x509 distinguished name and SASL username. It results in the creation of two authz-list objects with IDs of vnc.username and vnc.x509dname. The rules for these objects must be configured with the HMP ACL commands.

This option is deprecated and should no longer be used. The new sasl-authz and tls-authz options are a replacement.

Source

pub fn maybe_acl(self, value: Option<OnOff>) -> VNCBuilder<SetAcl<S>>
where S::Acl: IsUnset,

Optional (Some / Option setters).

Legacy method for enabling authorization of clients against the x509 distinguished name and SASL username. It results in the creation of two authz-list objects with IDs of vnc.username and vnc.x509dname. The rules for these objects must be configured with the HMP ACL commands.

This option is deprecated and should no longer be used. The new sasl-authz and tls-authz options are a replacement.

Source

pub fn lossy(self, value: OnOff) -> VNCBuilder<SetLossy<S>>
where S::Lossy: IsUnset,

Optional (Some / Option setters).

Enable lossy compression methods (gradient, JPEG, …). If this option is set, VNC client may receive lossy framebuffer updates depending on its encoding settings. Enabling this option can save a lot of bandwidth at the expense of quality.

Source

pub fn maybe_lossy(self, value: Option<OnOff>) -> VNCBuilder<SetLossy<S>>
where S::Lossy: IsUnset,

Optional (Some / Option setters).

Enable lossy compression methods (gradient, JPEG, …). If this option is set, VNC client may receive lossy framebuffer updates depending on its encoding settings. Enabling this option can save a lot of bandwidth at the expense of quality.

Source

pub fn non_adaptive(self, value: OnOff) -> VNCBuilder<SetNonAdaptive<S>>
where S::NonAdaptive: IsUnset,

Optional (Some / Option setters).

Disable adaptive encodings. Adaptive encodings are enabled by default. An adaptive encoding will try to detect frequently updated screen regions, and send updates in these regions using a lossy encoding (like JPEG). This can be really helpful to save bandwidth when playing videos. Disabling adaptive encodings restores the original static behavior of encodings like Tight.

Source

pub fn maybe_non_adaptive( self, value: Option<OnOff>, ) -> VNCBuilder<SetNonAdaptive<S>>
where S::NonAdaptive: IsUnset,

Optional (Some / Option setters).

Disable adaptive encodings. Adaptive encodings are enabled by default. An adaptive encoding will try to detect frequently updated screen regions, and send updates in these regions using a lossy encoding (like JPEG). This can be really helpful to save bandwidth when playing videos. Disabling adaptive encodings restores the original static behavior of encodings like Tight.

Source

pub fn share( self, value: AllowExclusiveForceSharedIgnore, ) -> VNCBuilder<SetShare<S>>
where S::Share: IsUnset,

Optional (Some / Option setters).

Set display sharing policy. ‘allow-exclusive’ allows clients to ask for exclusive access. As suggested by the rfb spec this is implemented by dropping other connections. Connecting multiple clients in parallel requires all clients asking for a shared session (vncviewer: -shared switch). This is the default. ‘force-shared’ disables exclusive client access. Useful for shared desktop sessions, where you don’t want someone forgetting specify -shared disconnect everybody else. ‘ignore’ completely ignores the shared flag and allows everybody connect unconditionally. Doesn’t conform to the rfb spec but is traditional QEMU behavior.

Source

pub fn maybe_share( self, value: Option<AllowExclusiveForceSharedIgnore>, ) -> VNCBuilder<SetShare<S>>
where S::Share: IsUnset,

Optional (Some / Option setters).

Set display sharing policy. ‘allow-exclusive’ allows clients to ask for exclusive access. As suggested by the rfb spec this is implemented by dropping other connections. Connecting multiple clients in parallel requires all clients asking for a shared session (vncviewer: -shared switch). This is the default. ‘force-shared’ disables exclusive client access. Useful for shared desktop sessions, where you don’t want someone forgetting specify -shared disconnect everybody else. ‘ignore’ completely ignores the shared flag and allows everybody connect unconditionally. Doesn’t conform to the rfb spec but is traditional QEMU behavior.

Source

pub fn key_delay_ms(self, value: usize) -> VNCBuilder<SetKeyDelayMs<S>>
where S::KeyDelayMs: IsUnset,

Optional (Some / Option setters).

Set keyboard delay, for key down and key up events, in milliseconds. Default is 10. Keyboards are low-bandwidth devices, so this slowdown can help the device and guest to keep up and not lose events in case events are arriving in bulk. Possible causes for the latter are flaky network connections, or scripts for automated testing.

Source

pub fn maybe_key_delay_ms( self, value: Option<usize>, ) -> VNCBuilder<SetKeyDelayMs<S>>
where S::KeyDelayMs: IsUnset,

Optional (Some / Option setters).

Set keyboard delay, for key down and key up events, in milliseconds. Default is 10. Keyboards are low-bandwidth devices, so this slowdown can help the device and guest to keep up and not lose events in case events are arriving in bulk. Possible causes for the latter are flaky network connections, or scripts for automated testing.

Source

pub fn audiodev(self, value: String) -> VNCBuilder<SetAudiodev<S>>
where S::Audiodev: IsUnset,

Optional (Some / Option setters).

Use the specified audiodev when the VNC client requests audio transmission. When not using an -audiodev argument, this option must be omitted, otherwise is must be present and specify a valid audiodev.

Source

pub fn maybe_audiodev(self, value: Option<String>) -> VNCBuilder<SetAudiodev<S>>
where S::Audiodev: IsUnset,

Optional (Some / Option setters).

Use the specified audiodev when the VNC client requests audio transmission. When not using an -audiodev argument, this option must be omitted, otherwise is must be present and specify a valid audiodev.

Source

pub fn power_control(self, value: OnOff) -> VNCBuilder<SetPowerControl<S>>
where S::PowerControl: IsUnset,

Optional (Some / Option setters).

Permit the remote client to issue shutdown, reboot or reset power control requests.

Source

pub fn maybe_power_control( self, value: Option<OnOff>, ) -> VNCBuilder<SetPowerControl<S>>
where S::PowerControl: IsUnset,

Optional (Some / Option setters).

Permit the remote client to issue shutdown, reboot or reset power control requests.

Auto Trait Implementations§

§

impl<S> Freeze for VNCBuilder<S>

§

impl<S> RefUnwindSafe for VNCBuilder<S>

§

impl<S> Send for VNCBuilder<S>

§

impl<S> Sync for VNCBuilder<S>

§

impl<S> Unpin for VNCBuilder<S>

§

impl<S> UnwindSafe for VNCBuilder<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.