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
impl Connector
Sourcepub fn exists(self) -> bool
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.
Sourcepub fn ty(self) -> ConnectorType
pub fn ty(self) -> ConnectorType
Returns the connector type.
Sourcepub fn set_mode(self, width: i32, height: i32, refresh_millihz: Option<u32>)
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.
Sourcepub fn width(self) -> i32
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.
Sourcepub fn height(self) -> i32
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.
Sourcepub fn refresh_rate(self) -> u32
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()
.
Sourcepub fn position(self) -> (i32, i32)
pub fn position(self) -> (i32, i32)
Retrieves the position of the output in the global compositor space.
Sourcepub fn set_position(self, x: i32, y: i32)
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.
Sourcepub fn set_enabled(self, enabled: bool)
pub fn set_enabled(self, enabled: bool)
Enables or disables the connector.
By default, all connectors are enabled.
Sourcepub fn set_transform(self, transform: Transform)
pub fn set_transform(self, transform: Transform)
Sets the transformation to apply to the content of this connector.
pub fn name(self) -> String
pub fn model(self) -> String
pub fn manufacturer(self) -> String
pub fn serial_number(self) -> String
Sourcepub fn set_vrr_mode(self, mode: VrrMode)
pub fn set_vrr_mode(self, mode: VrrMode)
Sets the VRR mode.
Sourcepub fn set_vrr_cursor_hz(self, hz: f64)
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.
Sourcepub fn set_tearing_mode(self, mode: TearingMode)
pub fn set_tearing_mode(self, mode: TearingMode)
Sets the tearing mode.
Sourcepub fn set_format(self, format: Format)
pub fn set_format(self, format: Format)
Sets the format to use for framebuffers.