OutputAction

Enum OutputAction 

Source
pub enum OutputAction {
    Off,
    On,
    Mode {
        mode: ModeToSet,
    },
    CustomMode {
        mode: ConfiguredMode,
    },
    Modeline {
        clock: f64,
        hdisplay: u16,
        hsync_start: u16,
        hsync_end: u16,
        htotal: u16,
        vdisplay: u16,
        vsync_start: u16,
        vsync_end: u16,
        vtotal: u16,
        hsync_polarity: HSyncPolarity,
        vsync_polarity: VSyncPolarity,
    },
    Scale {
        scale: ScaleToSet,
    },
    Transform {
        transform: Transform,
    },
    Position {
        position: PositionToSet,
    },
    Vrr {
        vrr: VrrToSet,
    },
}
Expand description

Output actions that niri can perform.

Variants§

§

Off

Turn off the output.

§

On

Turn on the output.

§

Mode

Set the output mode.

Fields

§mode: ModeToSet

Mode to set, or “auto” for automatic selection.

Run niri msg outputs to see the available modes.

§

CustomMode

Set a custom output mode.

Fields

§mode: ConfiguredMode

Custom mode to set.

§

Modeline

Set a custom VESA CVT modeline.

Fields

§clock: f64

The rate at which pixels are drawn in MHz.

§hdisplay: u16

Horizontal active pixels.

§hsync_start: u16

Horizontal sync pulse start position in pixels.

§hsync_end: u16

Horizontal sync pulse end position in pixels.

§htotal: u16

Total horizontal number of pixels before resetting the horizontal drawing position to zero.

§vdisplay: u16

Vertical active pixels.

§vsync_start: u16

Vertical sync pulse start position in pixels.

§vsync_end: u16

Vertical sync pulse end position in pixels.

§vtotal: u16

Total vertical number of pixels before resetting the vertical drawing position to zero.

§hsync_polarity: HSyncPolarity

Horizontal sync polarity: “+hsync” or “-hsync”.

§vsync_polarity: VSyncPolarity

Vertical sync polarity: “+vsync” or “-vsync”.

§

Scale

Set the output scale.

Fields

§scale: ScaleToSet

Scale factor to set, or “auto” for automatic selection.

§

Transform

Set the output transform.

Fields

§transform: Transform

Transform to set, counter-clockwise.

§

Position

Set the output position.

Fields

§position: PositionToSet

Position to set, or “auto” for automatic selection.

§

Vrr

Set the variable refresh rate mode.

Fields

§vrr: VrrToSet

Variable refresh rate mode to set.

Implementations§

Source§

impl OutputAction

Source

pub fn validate(&self) -> Result<(), String>

Validates some required constraints on the modeline and custom mode.

Trait Implementations§

Source§

impl Clone for OutputAction

Source§

fn clone(&self) -> OutputAction

Returns a duplicate 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 OutputAction

Source§

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

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

impl<'de> Deserialize<'de> for OutputAction

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 Serialize for OutputAction

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

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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>,