1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Immutable snapshot of a single desktop icon's observable state.
use std::path::PathBuf;
use crate::{IconId, Point};
/// Everything the enumeration layer knows about one desktop icon at the
/// moment the snapshot was taken.
///
/// `path` is `None` for virtual items (e.g. *This PC*, *Recycle Bin*).
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct IconSnapshot {
pub id: IconId,
pub display_name: String,
pub path: Option<PathBuf>,
pub is_virtual: bool,
pub position: Point,
}
impl IconSnapshot {
#[inline]
pub fn new(
id: IconId,
display_name: impl Into<String>,
path: Option<PathBuf>,
is_virtual: bool,
position: Point,
) -> Self {
Self {
id,
display_name: display_name.into(),
path,
is_virtual,
position,
}
}
}