Info

Struct Info 

Source
pub struct Info(/* private fields */);
Expand description

Information about a display device.

This includes at least one EDID or DisplayID blob.

Use Info::parse_edid to create a Info from an EDID blob. DisplayID blobs are not yet supported.

Implementations§

Source§

impl Info

Source

pub fn parse_edid(data: &[u8]) -> Result<Self, ParseFailed>

Parse an EDID blob.

Source

pub fn failure_msg(&self) -> Option<&CStr>

Get the failure messages for this blob.

None is returned if the blob conforms to the relevant specifications.

Source

pub fn edid(&self) -> Option<Edid<'_>>

Returns the EDID the display device information was constructed with.

The returned Edid can be used to query low-level EDID information, see edid module level docs. Users should prefer the high-level API if possible.

None is returned if the Info doesn’t contain an EDID.

Source

pub fn make(&self) -> Option<String>

Get the make of the display device.

This is the manufacturer name, either company name or PNP ID. This string is informational and not meant to be used in programmatic decisions, configuration keys, etc.

The string is in UTF-8 and may contain any characters except ASCII control codes.

None is returned if the information is not available.

Source

pub fn model(&self) -> Option<String>

Get the model of the display device.

This is the product name/model string or product number. This string is informational and not meant to be used in programmatic decisions, configuration keys, etc.

The string is in UTF-8 and may contain any characters except ASCII control codes.

None is returned if the information is not available.

Source

pub fn serial(&self) -> Option<String>

Get the serial of the display device.

This is the product serial string or the serial number. This string is informational and not meant to be used in programmatic decisions, configuration keys, etc.

The string is in UTF-8 and may contain any characters except ASCII control codes.

None is returned if the information is not available.

Source

pub fn hdr_static_metadata(&self) -> HdrStaticMetadata

Available on crate features v0_2 or v0_3 only.

Get HDR static metadata support information as defined in ANSI/CTA-861-H as HDR Static Metadata Data Block.

When HDR static metadata does not exist, all luminance fields are zero and only traditional_sdr is flagged as supported.

Source

pub fn default_color_primaries(&self) -> ColorPrimaries

Available on crate features v0_2 or v0_3 only.

Get display color primaries and default white point

Get the parameters of the default RGB colorimetry mode which is always supported. Primaries for monochrome displays might be all zeroes.

These primaries might not be display’s physical primaries, but only the primaries of the default RGB colorimetry signal when using IT Video Format (ANSI/CTA-861-H, Section 5).

Source

pub fn supported_signal_colorimetry(&self) -> SupportedSignalColorimetry

Available on crate features v0_2 or v0_3 only.

Get signal colorimetry encodings supported by the display

These signal colorimetry encodings are supported in addition to the display’s default RGB colorimetry. When you wish to use one of the additional encodings, they need to be explicitly enabled in the video signal. How to do that is specific to the signalling used, e.g. HDMI.

Signal colorimetry encoding provides the color space that the signal is encoded for. This includes primary and white point chromaticities, and the YCbCr-RGB conversion if necessary. Also the transfer function is implied unless explicitly set otherwise, e.g. with HDR static metadata. See ANSI/CTA-861-H for details.

The signal color volume can be considerably larger than the physically displayable color volume.

Source

pub fn default_gamma(&self) -> Option<f32>

Available on crate features v0_2 or v0_3 only.

Get display default transfer characteristic exponent (gamma)

This should be the display gamma value when the display has been reset to its factory defaults, and it is driven with the default RGB colorimetry.

Returns None when unknown.

Trait Implementations§

Source§

impl Debug for Info

Source§

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

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

impl Drop for Info

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Info

§

impl RefUnwindSafe for Info

§

impl !Send for Info

§

impl !Sync for Info

§

impl Unpin for Info

§

impl UnwindSafe for Info

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> 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, 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.