pub struct MonitorLayoutEntry { /* private fields */ }
Expand description
[2.2.2.2.1] DISPLAYCONTROL_MONITOR_LAYOUT_PDU
Implementations§
Source§impl MonitorLayoutEntry
impl MonitorLayoutEntry
Sourcepub fn adjust_display_size(width: u32, height: u32) -> (u32, u32)
pub fn adjust_display_size(width: u32, height: u32) -> (u32, u32)
Adjusts the display size to be within the valid range.
Per [2.2.2.2.1]:
- The
width
MUST be greater than or equal to 200 pixels and less than or equal to 8192 pixels, and MUST NOT be an odd value. - The
height
MUST be greater than or equal to 200 pixels and less than or equal to 8192 pixels.
Functions that create MonitorLayoutEntry
should typically use this function to adjust the display size first.
Sourcepub fn new_primary(width: u32, height: u32) -> EncodeResult<Self>
pub fn new_primary(width: u32, height: u32) -> EncodeResult<Self>
Creates a new primary MonitorLayoutEntry
.
Per [2.2.2.2.1]:
- The
width
MUST be greater than or equal to 200 pixels and less than or equal to 8192 pixels, and MUST NOT be an odd value. - The
height
MUST be greater than or equal to 200 pixels and less than or equal to 8192 pixels.
Use MonitorLayoutEntry::adjust_display_size
before calling this function to ensure the display size is within the valid range.
Sourcepub fn new_secondary(width: u32, height: u32) -> EncodeResult<Self>
pub fn new_secondary(width: u32, height: u32) -> EncodeResult<Self>
Creates a new primary MonitorLayoutEntry
.
Per [2.2.2.2.1]:
- The
width
MUST be greater than or equal to 200 pixels and less than or equal to 8192 pixels, and MUST NOT be an odd value. - The
height
MUST be greater than or equal to 200 pixels and less than or equal to 8192 pixels.
Use MonitorLayoutEntry::adjust_display_size
before calling this function to ensure the display size is within the valid range.
Sourcepub fn with_orientation(self, orientation: MonitorOrientation) -> Self
pub fn with_orientation(self, orientation: MonitorOrientation) -> Self
Sets the monitor’s orientation. (Default is MonitorOrientation::Landscape
)
Sourcepub fn with_position(self, left: i32, top: i32) -> EncodeResult<Self>
pub fn with_position(self, left: i32, top: i32) -> EncodeResult<Self>
Sets the monitor’s position (left, top) in pixels. (Default is (0, 0))
Note: The primary monitor position must be always (0, 0).
Sourcepub fn with_device_scale_factor(
self,
device_scale_factor: DeviceScaleFactor,
) -> Self
pub fn with_device_scale_factor( self, device_scale_factor: DeviceScaleFactor, ) -> Self
Sets the monitor’s device scale factor in percent. (Default is DeviceScaleFactor::Scale100Percent
)
Sourcepub fn with_desktop_scale_factor(
self,
desktop_scale_factor: u32,
) -> EncodeResult<Self>
pub fn with_desktop_scale_factor( self, desktop_scale_factor: u32, ) -> EncodeResult<Self>
Sets the monitor’s desktop scale factor in percent.
NOTE: As specified in [MS-RDPEDISP], if the desktop scale factor is not in the valid range (100..=500 percent), the monitor desktop scale factor is considered invalid and should be ignored.
Sourcepub fn with_physical_dimensions(
self,
physical_width: u32,
physical_height: u32,
) -> EncodeResult<Self>
pub fn with_physical_dimensions( self, physical_width: u32, physical_height: u32, ) -> EncodeResult<Self>
Sets the monitor’s physical dimensions in millimeters.
NOTE: As specified in [MS-RDPEDISP], if the physical dimensions are not in the valid range (10..=10000 millimeters), the monitor physical dimensions are considered invalid and should be ignored.
pub fn is_primary(&self) -> bool
Sourcepub fn position(&self) -> Option<(i32, i32)>
pub fn position(&self) -> Option<(i32, i32)>
Returns the monitor’s position (left, top) in pixels.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Returns the monitor’s dimensions (width, height) in pixels.
Sourcepub fn orientation(&self) -> Option<MonitorOrientation>
pub fn orientation(&self) -> Option<MonitorOrientation>
Returns the monitor’s orientation if it is valid.
NOTE: As specified in [MS-RDPEDISP], if the orientation is not one of the valid values (0, 90, 180, 270), the monitor orientation is considered invalid and should be ignored.
Sourcepub fn physical_dimensions(&self) -> Option<(u32, u32)>
pub fn physical_dimensions(&self) -> Option<(u32, u32)>
Returns the monitor’s physical dimensions (width, height) in millimeters.
NOTE: As specified in [MS-RDPEDISP], if the physical dimensions are not in the valid range (10..=10000 millimeters), the monitor physical dimensions are considered invalid and should be ignored.
Sourcepub fn desktop_scale_factor(&self) -> Option<u32>
pub fn desktop_scale_factor(&self) -> Option<u32>
Returns the monitor’s device scale factor in percent if it is valid.
NOTE: As specified in [MS-RDPEDISP], if the desktop scale factor is not in the valid range (100..=500 percent), the monitor desktop scale factor is considered invalid and should be ignored.
IMPORTANT: When processing scale factors, make sure that both desktop and device scale factors are valid, otherwise they both should be ignored.
Sourcepub fn device_scale_factor(&self) -> Option<DeviceScaleFactor>
pub fn device_scale_factor(&self) -> Option<DeviceScaleFactor>
Returns the monitor’s device scale factor in percent if it is valid.
IMPORTANT: When processing scale factors, make sure that both desktop and device scale factors are valid, otherwise they both should be ignored.
Trait Implementations§
Source§impl Clone for MonitorLayoutEntry
impl Clone for MonitorLayoutEntry
Source§fn clone(&self) -> MonitorLayoutEntry
fn clone(&self) -> MonitorLayoutEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MonitorLayoutEntry
impl Debug for MonitorLayoutEntry
Source§impl<'de> Decode<'de> for MonitorLayoutEntry
impl<'de> Decode<'de> for MonitorLayoutEntry
Source§fn decode(src: &mut ReadCursor<'de>) -> DecodeResult<Self>
fn decode(src: &mut ReadCursor<'de>) -> DecodeResult<Self>
Self
from the given byte stream. Read moreSource§impl Encode for MonitorLayoutEntry
impl Encode for MonitorLayoutEntry
Source§impl PartialEq for MonitorLayoutEntry
impl PartialEq for MonitorLayoutEntry
impl Eq for MonitorLayoutEntry
impl StructuralPartialEq for MonitorLayoutEntry
Auto Trait Implementations§
impl Freeze for MonitorLayoutEntry
impl RefUnwindSafe for MonitorLayoutEntry
impl Send for MonitorLayoutEntry
impl Sync for MonitorLayoutEntry
impl Unpin for MonitorLayoutEntry
impl UnwindSafe for MonitorLayoutEntry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.