VncServer

Struct VncServer 

Source
pub struct VncServer<S: Server<K>, K = SocketAddr> {
    pub server: Arc<dyn Fn(&K) -> Arc<S> + Send + Sync>,
    /* private fields */
}

Fields§

§server: Arc<dyn Fn(&K) -> Arc<S> + Send + Sync>

The underlying Server implementation

Implementations§

Source§

impl<S: Server<K>, K: Debug + Send + Sync + 'static> VncServer<S, K>

Source

pub fn new(server: S, config: VncServerConfig, data: VncServerData) -> Arc<Self>

Source

pub fn new_base( server: Arc<dyn Fn(&K) -> Arc<S> + Send + Sync>, config: VncServerConfig, data: VncServerData, ) -> Arc<Self>

Source

pub async fn set_pixel_format(&self, pixel_format: PixelFormat)

Source

pub async fn set_resolution(&self, width: u16, height: u16)

Source

pub async fn handle_conn( &self, s: &mut (impl AsyncRead + AsyncWrite + Unpin + Send + Sync), addr: K, close_ch: Shared<Receiver<()>>, )

Source

pub async fn start(self: &Arc<Self>) -> Result<()>
where K: From<SocketAddr>,

Start listening for incoming connections.

Source

pub async fn stop(self: &Arc<Self>)

Stop the server (and disconnect any client) if it’s running.

Auto Trait Implementations§

§

impl<S, K = SocketAddr> !Freeze for VncServer<S, K>

§

impl<S, K = SocketAddr> !RefUnwindSafe for VncServer<S, K>

§

impl<S, K> Send for VncServer<S, K>

§

impl<S, K> Sync for VncServer<S, K>

§

impl<S, K> Unpin for VncServer<S, K>

§

impl<S, K = SocketAddr> !UnwindSafe for VncServer<S, K>

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.