Initialize Rust GPUI browser shell

This commit is contained in:
2026-05-07 18:27:15 -04:00
commit d9a27f3dc4
41 changed files with 11573 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
use crate::SpaceId;
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ArchivePolicy {
Manual,
IdleDays(u16),
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Space {
id: SpaceId,
name: String,
icon: String,
accent_hex: u32,
archive_policy: ArchivePolicy,
}
impl Space {
#[must_use]
pub fn new(name: impl Into<String>, icon: impl Into<String>, accent_hex: u32) -> Self {
Self {
id: SpaceId::new(),
name: name.into(),
icon: icon.into(),
accent_hex,
archive_policy: ArchivePolicy::Manual,
}
}
#[must_use]
pub fn id(&self) -> &SpaceId {
&self.id
}
#[must_use]
pub fn name(&self) -> &str {
&self.name
}
#[must_use]
pub fn icon(&self) -> &str {
&self.icon
}
#[must_use]
pub fn accent_hex(&self) -> u32 {
self.accent_hex
}
#[must_use]
pub fn archive_policy(&self) -> &ArchivePolicy {
&self.archive_policy
}
}