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: u64Implementations§
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.
Sourcepub fn set_colors(
self,
color_space: ColorSpace,
transfer_function: TransferFunction,
)
pub fn set_colors( self, color_space: ColorSpace, transfer_function: TransferFunction, )
Sets the color space and transfer function of the connector.
By default, the default values are used which usually means sRGB color space with sRGB transfer function.
If the output supports it, HDR10 can be enabled by setting the color space to BT.2020 and the transfer function to PQ.
Note that some displays might ignore incompatible settings.
Sourcepub fn set_brightness(self, brightness: Option<f64>)
pub fn set_brightness(self, brightness: Option<f64>)
Sets the brightness of the output.
By default or when brightness is None, the brightness depends on the
transfer function:
TransferFunction::DEFAULT: The maximum brightness of the output.TransferFunction::PQ: 203 cd/m^2.
This should only be used with the PQ transfer function. If the default transfer function is used, you should instead calibrate the hardware directly.
This has no effect unless the vulkan renderer is used.
Sourcepub fn active_workspace(self) -> Workspace
pub fn active_workspace(self) -> Workspace
Get the currently visible/active workspace.
If this connector is not connected, or is there no active workspace, returns a
workspace whose exists() returns false.
Sourcepub fn workspaces(self) -> Vec<Workspace>
pub fn workspaces(self) -> Vec<Workspace>
Get all workspaces on this connector.
If this connector is not connected, returns an empty list.