Struct Connector

Source
pub struct Connector(pub u64);
Expand description

A connector that is potentially connected to an output device.

A connector is the part that sticks out of your graphics card. A graphics card usually has many connectors but one few of them are actually connected to a monitor.

Tuple Fields§

§0: u64

Implementations§

Source§

impl Connector

Source

pub fn exists(self) -> bool

Returns whether this connector existed at the time get_connector was called.

This only implies existence at the time get_connector was called. Even if this function returns true, the connector might since have disappeared.

Source

pub fn connected(self) -> bool

Returns whether the connector is connected to an output device.

Source

pub fn scale(self) -> f64

Returns the scale of the currently connected monitor.

Source

pub fn set_scale(self, scale: f64)

Sets the scale to use for the currently connected monitor.

Source

pub fn ty(self) -> ConnectorType

Returns the connector type.

Source

pub fn mode(self) -> Mode

Returns the current mode of the connector.

Source

pub fn set_mode(self, width: i32, height: i32, refresh_millihz: Option<u32>)

Tries to set the mode of the connector.

If the refresh rate is not specified, tries to use the first mode with the given width and height.

The default mode is the first mode advertised by the connector. This is usually the native mode.

Source

pub fn modes(self) -> Vec<Mode>

Returns the available modes of the connector.

Source

pub fn width(self) -> i32

Returns the logical width of the connector.

The returned value will be different from mode().width() if the scale is not 1.

Source

pub fn height(self) -> i32

Returns the logical height of the connector.

The returned value will be different from mode().height() if the scale is not 1.

Source

pub fn refresh_rate(self) -> u32

Returns the refresh rate in mhz of the current mode of the connector.

This is a shortcut for mode().refresh_rate().

Source

pub fn position(self) -> (i32, i32)

Retrieves the position of the output in the global compositor space.

Source

pub fn set_position(self, x: i32, y: i32)

Sets the position of the connector in the global compositor space.

x and y must be non-negative and must not exceed a currently unspecified limit. Any reasonable values for x and y should work.

This function allows the connector to overlap with other connectors, however, such configurations are not supported and might result in unexpected behavior.

Source

pub fn set_enabled(self, enabled: bool)

Enables or disables the connector.

By default, all connectors are enabled.

Source

pub fn set_transform(self, transform: Transform)

Sets the transformation to apply to the content of this connector.

Source

pub fn name(self) -> String

Source

pub fn model(self) -> String

Source

pub fn manufacturer(self) -> String

Source

pub fn serial_number(self) -> String

Source

pub fn set_vrr_mode(self, mode: VrrMode)

Sets the VRR mode.

Source

pub fn set_vrr_cursor_hz(self, hz: f64)

Sets the VRR cursor refresh rate.

Limits the rate at which cursors are updated on screen when VRR is active.

Setting this to infinity disables the limiter.

Source

pub fn set_tearing_mode(self, mode: TearingMode)

Sets the tearing mode.

Source

pub fn set_format(self, format: Format)

Sets the format to use for framebuffers.

Trait Implementations§

Source§

impl Clone for Connector

Source§

fn clone(&self) -> Connector

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 Debug for Connector

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Connector

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Connector

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Connector

Source§

fn eq(&self, other: &Connector) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Connector

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for Connector

Source§

impl Eq for Connector

Source§

impl StructuralPartialEq for Connector

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,