pub struct XHandle { /* private fields */ }
Implementations§
Source§impl XHandle
impl XHandle
Sourcepub fn open() -> Result<Self, XrandrError>
pub fn open() -> Result<Self, XrandrError>
Sourcepub fn all_outputs(&mut self) -> Result<Vec<Output>, XrandrError>
pub fn all_outputs(&mut self) -> Result<Vec<Output>, XrandrError>
Sourcepub fn set_primary(&mut self, o: &Output)
pub fn set_primary(&mut self, o: &Output)
Sourcepub fn set_mode(
&mut self,
output: &Output,
mode: &Mode,
) -> Result<(), XrandrError>
pub fn set_mode( &mut self, output: &Output, mode: &Mode, ) -> Result<(), XrandrError>
Sets the mode of a given output, relative to another
§Arguments
output
- The output to change mode formode
- The mode to change to
§Errors
XrandrError::_
- various calls to the xrandr backend may fail
§Examples
let dp_1 = xhandle.all_outputs()?[0];
let mode = dp_1.preferred_modes[0];
xhandle.set_mode(dp_1, mode)?;
Sourcepub fn set_position(
&mut self,
output: &Output,
relation: &Relation,
relative_output: &Output,
) -> Result<(), XrandrError>
pub fn set_position( &mut self, output: &Output, relation: &Relation, relative_output: &Output, ) -> Result<(), XrandrError>
Sets the position of a given output, relative to another
§Arguments
output
- The output to repositionrelation
- The relationoutput
will have torel_output
rel_output
- The output to position relative to
§Errors
XrandrError::_
- various calls to the xrandr backend may fail
§Examples
let dp_1 = outputs[0];
let hdmi_1 = outputs[3];
xhandle.set_position(dp_1, Relation::LeftOf, hdmi_1)?;
Sourcepub fn set_rotation(
&mut self,
output: &Output,
rotation: &Rotation,
) -> Result<(), XrandrError>
pub fn set_rotation( &mut self, output: &Output, rotation: &Rotation, ) -> Result<(), XrandrError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for XHandle
impl RefUnwindSafe for XHandle
impl !Send for XHandle
impl !Sync for XHandle
impl Unpin for XHandle
impl UnwindSafe for XHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more