[][src]Struct surfman::platform::unix::wayland::connection::Connection

pub struct Connection { /* fields omitted */ }

A connection to the Wayland server.

Implementations

impl Connection[src]

pub fn new() -> Result<Connection, Error>[src]

Connects to the default Wayland server.

pub unsafe fn from_native_connection(
    native_connection: NativeConnection
) -> Result<Connection, Error>
[src]

Wraps an existing EGL display in a Connection.

The display is not retained, as there is no way to do this in the EGL API. Therefore, it is the caller's responsibility to ensure that the EGL display remains alive as long as the connection is.

pub fn native_connection(&self) -> NativeConnection[src]

Returns the underlying native connection.

pub fn gl_api(&self) -> GLApi[src]

Returns the OpenGL API flavor that this connection supports (OpenGL or OpenGL ES).

pub fn create_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring high-performance hardware adapters.

This is an alias for Connection::create_hardware_adapter().

pub fn create_hardware_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring high-performance hardware adapters.

pub fn create_low_power_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring low-power hardware adapters.

pub fn create_software_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring software adapters.

pub fn create_device(&self, adapter: &Adapter) -> Result<Device, Error>[src]

Opens the hardware device corresponding to the given adapter.

Device handles are local to a single thread.

pub unsafe fn create_device_from_native_device(
    &self,
    native_device: NativeDevice
) -> Result<Device, Error>
[src]

Opens the hardware device corresponding to the adapter wrapped in the given native device.

This is present for compatibility with other backends.

pub fn from_winit_window(window: &Window) -> Result<Connection, Error>[src]

Opens the display connection corresponding to the given winit window.

pub fn create_native_widget_from_winit_window(
    &self,
    window: &Window
) -> Result<NativeWidget, Error>
[src]

Creates a native widget type from the given winit window.

This type can be later used to create surfaces that render to the window.

pub unsafe fn create_native_widget_from_ptr(
    &self,
    raw: *mut c_void,
    size: Size2D<i32>
) -> NativeWidget
[src]

Create a native widget from a raw pointer

Trait Implementations

impl Clone for Connection[src]

impl Connection for Connection[src]

type Adapter = Adapter

The adapter type associated with this connection.

type Device = Device

The device type associated with this connection.

type NativeConnection = NativeConnection

The native type associated with this connection.

type NativeDevice = NativeDevice

The native device type associated with this connection.

type NativeWidget = NativeWidget

The native widget type associated with this connection.

impl Send for Connection[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.