pub struct Parser {
    pub outputs: Vec<String>,
    pub connected_outputs: Vec<String>,
    pub connectors: Vec<Connector>,
    pub screen: Screen,
}

Fields

outputs: Vec<String>

Every Connector.name

connected_outputs: Vec<String>

Every Connector.name where Connector.status is true

connectors: Vec<Connector>

Every Connector Struct

screen: Screen

The Virtual Screen

Implementations

Create a new instance of Parser

Populate properties of an instance of Parser from the output of Parser::parse_query()

Getter function for Parser.outputs

Example
 #[allow(non_snake_case)]

 use xrandr_parser::Parser;

 fn main() -> Result<(), String> {
     let mut XrandrParser = Parser::new();

     XrandrParser.parse()?;

     let outputs = &XrandrParser.outputs();

     Ok(())
 }

Getter function for Parser.connected_outputs

Example
#[allow(non_snake_case)]

use xrandr_parser::Parser;

fn main() -> Result<(), String> {
    let mut XrandrParser = Parser::new();

    XrandrParser.parse()?;

    let connected_outputs = &XrandrParser.connected_outputs();

    println!("Connected Outputs: {:?}", connected_outputs);

    Ok(())
}

Getter function for Parser.connectors

Example
 #[allow(non_snake_case)]

 use xrandr_parser::Parser;

 fn main() -> Result<(), String> {
     let mut XrandrParser = Parser::new();

     XrandrParser.parse()?;

     let connectors = &XrandrParser.connectors();

     println!("Connectors: {:#?}", connectors);

     Ok(())
}

Getter function for Parser.screen

Example
#[allow(non_snake_case)]

use xrandr_parser::Parser;

fn main() -> Result<(), String> {
    let mut XrandrParser = Parser::new();

    XrandrParser.parse()?;

    let screen = &XrandrParser.screen();

    println!("Screen Information: {:#?}", screen);

    Ok(())
}

Get the connector struct for a with the name provided. Returns "Not found" if the connector is not found in self.connectors.

Example
#[allow(non_snake_case)]

use xrandr_parser::Parser;

fn main() -> Result<(), String> {
    let mut XrandrParser = Parser::new();

    XrandrParser.parse()?;

    let connector = &XrandrParser.get_connector("HDMI-1")?;

    println!("Connector - HDMI-1: {:#?}", connector);

    Ok(())
}

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.