pub struct MonitorIdent(/* private fields */);
Expand description
Identifier for a given monitor. Because there is no cross platform method to actually uniquely identify monitors, this tuple wraps two identifiers of a monitor which should prove sufficient on any given system: The index of the monitor is the retrieved Display array, and the name of the given monitor.
Implementations§
Source§impl MonitorIdent
A semi-stable serializable identifier for a monitor.
Useful for keeping fullscreen configuration persistent.
impl MonitorIdent
A semi-stable serializable identifier for a monitor. Useful for keeping fullscreen configuration persistent.
Sourcepub fn from_primary(monitors: &impl MonitorsAccess) -> Self
pub fn from_primary(monitors: &impl MonitorsAccess) -> Self
Get the identifier for current primary monitor.
Sourcepub fn from_monitor_id(
monitors: &impl MonitorsAccess,
monitor_id: MonitorId,
) -> Option<Self>
pub fn from_monitor_id( monitors: &impl MonitorsAccess, monitor_id: MonitorId, ) -> Option<Self>
Get the identifier for specific monitor id.
Sourcepub fn monitor_id(&self, monitors: &impl MonitorsAccess) -> MonitorId
pub fn monitor_id(&self, monitors: &impl MonitorsAccess) -> MonitorId
Select a monitor that matches this identifier most closely.
Trait Implementations§
Source§impl Clone for MonitorIdent
impl Clone for MonitorIdent
Source§fn clone(&self) -> MonitorIdent
fn clone(&self) -> MonitorIdent
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MonitorIdent
impl Debug for MonitorIdent
Source§impl<'de> Deserialize<'de> for MonitorIdent
impl<'de> Deserialize<'de> for MonitorIdent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for MonitorIdent
impl PartialEq for MonitorIdent
Source§impl Serialize for MonitorIdent
impl Serialize for MonitorIdent
impl Eq for MonitorIdent
impl StructuralPartialEq for MonitorIdent
Auto Trait Implementations§
impl Freeze for MonitorIdent
impl RefUnwindSafe for MonitorIdent
impl Send for MonitorIdent
impl Sync for MonitorIdent
impl Unpin for MonitorIdent
impl UnwindSafe for MonitorIdent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize,
impl<T> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize,
Source§fn load<P>(path: P) -> Result<T, ConfigError>
fn load<P>(path: P) -> Result<T, ConfigError>
Loads a configuration structure from a file.
Source§fn load_bytes(bytes: &[u8]) -> Result<T, ConfigError>
fn load_bytes(bytes: &[u8]) -> Result<T, ConfigError>
Loads configuration structure from raw bytes.
Source§fn write<P>(&self, path: P) -> Result<(), ConfigError>
fn write<P>(&self, path: P) -> Result<(), ConfigError>
Writes a configuration structure to a file.
Source§fn load_no_fallback<P>(path: P) -> Result<Self, ConfigError>
fn load_no_fallback<P>(path: P) -> Result<Self, ConfigError>
👎Deprecated: use
load
insteadLoads a configuration structure from a file.
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.