pub type Connection = Connection<Device<Device, Device>, Device>;
Expand description

Either a Wayland or an X11 display server connection.

Aliased Type§

enum Connection {
    Default(Connection<Device, Device>),
    Alternate(Connection),
}

Variants§

§

Default(Connection<Device, Device>)

The default connection to the display server.

§

Alternate(Connection)

The alternate connection to the display server.

Implementations§

source§

impl<Def, Alt> Connection<Def, Alt>where Def: DeviceInterface, Alt: DeviceInterface, Def::Connection: ConnectionInterface<Device = Def>, Alt::Connection: ConnectionInterface<Device = Alt>,

source

pub fn new() -> Result<Connection<Def, Alt>, Error>

Connects to the default display.

source

pub fn native_connection(&self) -> NativeConnection<Def, Alt>

Returns the native connection corresponding to this connection.

source

pub fn gl_api(&self) -> GLApi

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

source

pub fn create_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

Returns the “best” adapter on this system.

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

source

pub fn create_hardware_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

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

source

pub fn create_low_power_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

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

source

pub fn create_software_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

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

source

pub fn create_device( &self, adapter: &Adapter<Def, Alt> ) -> Result<Device<Def, Alt>, Error>

Opens the hardware device corresponding to the given adapter.

Device handles are local to a single thread.

source

pub unsafe fn create_device_from_native_device( &self, native_device: NativeDevice<Def, Alt> ) -> Result<Device<Def, Alt>, Error>

Wraps a native device in a device.

source

pub fn from_raw_display_handle( raw_handle: RawDisplayHandle ) -> Result<Connection<Def, Alt>, Error>

Opens the display connection corresponding to the given raw display handle.

source

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

Create a native widget from a raw pointer

source

pub fn create_native_widget_from_raw_window_handle( &self, raw_handle: RawWindowHandle, size: Size2D<i32> ) -> Result<NativeWidget<Def, Alt>, Error>

Create a native widget type from the given raw_window_handle::HasRawWindowHandle.

Trait Implementations§

source§

impl<Def, Alt> Clone for Connection<Def, Alt>where Def: DeviceInterface, Alt: DeviceInterface, Def::Connection: Clone, Alt::Connection: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Def, Alt> Connection for Connection<Def, Alt>where Def: DeviceInterface, Alt: DeviceInterface, Def::Connection: ConnectionInterface<Device = Def>, Alt::Connection: ConnectionInterface<Device = Alt>,

§

type Adapter = Adapter<Def, Alt>

The adapter type associated with this connection.
§

type Device = Device<Def, Alt>

The device type associated with this connection.
§

type NativeConnection = NativeConnection<Def, Alt>

The native type associated with this connection.
§

type NativeDevice = NativeDevice<Def, Alt>

The native device type associated with this connection.
§

type NativeWidget = NativeWidget<Def, Alt>

The native widget type associated with this connection.
source§

fn new() -> Result<Connection<Def, Alt>, Error>

Connects to the default display.
source§

fn native_connection(&self) -> NativeConnection<Def, Alt>

Returns the native connection corresponding to this connection.
source§

fn gl_api(&self) -> GLApi

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

fn create_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

Returns the “best” adapter on this system, preferring high-performance hardware adapters. Read more
source§

fn create_hardware_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

Returns the “best” adapter on this system, preferring high-performance hardware adapters.
source§

fn create_low_power_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

Returns the “best” adapter on this system, preferring low-power hardware adapters.
source§

fn create_software_adapter(&self) -> Result<Adapter<Def, Alt>, Error>

Returns the “best” adapter on this system, preferring software adapters.
source§

fn create_device( &self, adapter: &Adapter<Def, Alt> ) -> Result<Device<Def, Alt>, Error>

Opens a device.
source§

unsafe fn create_device_from_native_device( &self, native_device: NativeDevice<Def, Alt> ) -> Result<Device<Def, Alt>, Error>

Wraps an existing native device type in a device.
source§

fn from_raw_display_handle( raw_handle: RawDisplayHandle ) -> Result<Connection<Def, Alt>, Error>

Opens the display connection corresponding to the given raw display handle.
source§

unsafe fn create_native_widget_from_ptr( &self, raw: *mut c_void, size: Size2D<i32> ) -> NativeWidget<Def, Alt>

Creates a native widget from a raw pointer
source§

fn create_native_widget_from_raw_window_handle( &self, raw_handle: RawWindowHandle, size: Size2D<i32> ) -> Result<Self::NativeWidget, Error>

Create a native widget type from the given raw_window_handle::RawWindowHandle.